surya-koritala/cyntr

GitHub: surya-koritala/cyntr

一个自托管的企业级 AI Agent 平台,提供策略引擎、审计日志和多租户隔离能力,支持单一二进制零依赖部署。

Stars: 1 | Forks: 0

Cyntr

The enterprise AI agent platform. Open source.

Release License Go Tests

Cyntr 是一个自托管平台,用于在您的组织中运行、保护和管理 AI agent。单一 Go 二进制文件。零外部依赖。22,000 行代码。505 个测试。 ## 安装 ``` curl -fsSL https://cyntr.dev/install.sh | sh ``` 或从源码构建: ``` git clone https://github.com/surya-koritala/cyntr.git cd cyntr && go build -o cyntr ./cmd/cyntr ``` ## 快速开始 ``` # 交互式设置向导 cyntr init # 启动服务器 ANTHROPIC_API_KEY=sk-ant-... cyntr start ``` Dashboard 将在 **http://localhost:7700** 打开 ## Cyntr 的功能 Cyntr 允许您部署 AI agent,这些 agent 可以在 Slack 上交流、浏览网页、管理 GitHub issues、编写文件并自动化工作流 —— 所有这些都位于具有完整审计日志的默认拒绝策略引擎之后。 - **运行 agent** —— 跨 Claude、GPT、Gemini、Ollama 或任何 OpenAI 兼容 API - **连接渠道** —— Slack、Teams、WhatsApp、Telegram、Discord、Email - **使用工具** —— shell、HTTP、文件操作、web 浏览器、GitHub、Jira - **自动化工作流** —— 通过条件、重试和 webhook 链接 agent 操作 - **强制安全** —— 策略引擎在执行前检查每个操作 - **记录一切** —— 具有哈希链的防篡改审计跟踪 - **隔离租户** —— 为每个团队分离 agent、策略和数据 - **跨站点扩展** —— 具有策略同步和跨站点审计查询的联合功能 ## 使用 ### 通过 API 与 agent 聊天 ``` # 创建带工具的 Agent curl -X POST http://localhost:7700/api/v1/tenants/my-org/agents \ -H "Content-Type: application/json" \ -d '{"name":"assistant","model":"claude","system_prompt":"You are helpful.", "tools":["browse_web","file_read","github"]}' # 聊天 curl -X POST http://localhost:7700/api/v1/tenants/my-org/agents/assistant/chat \ -H "Content-Type: application/json" \ -d '{"message":"Check the weather in New York"}' ``` ### 通过 Slack 聊天 设置 `SLACK_BOT_TOKEN`,您的 agent 将直接在 Slack 频道中响应,并拥有完整的工具访问权限。 ### 使用工作流自动化 ``` curl -X POST http://localhost:7700/api/v1/workflows \ -d '{"name":"daily-report","tenant":"my-org","start_step":"fetch", "steps":[ {"id":"fetch","type":"agent_chat", "config":{"agent":"assistant","message":"Browse our status page and summarize"},"on_success":"write"}, {"id":"write","type":"agent_chat", "config":{"agent":"assistant","message":"Write summary to /tmp/report.txt: {{fetch.output}}"}} ]}' ``` ### 使用 CLI ``` cyntr init # Setup wizard cyntr start # Start server cyntr doctor # Validate config cyntr agent create my-org bot --model claude cyntr agent chat my-org bot "What's on my calendar?" cyntr tenant list cyntr audit query --tenant finance cyntr policy test --tenant demo --action tool_call --tool shell_exec cyntr skill import-openclaw ./my-skill/SKILL.md cyntr federation peers ``` ## 特性 ### AI Runtime | Feature | Details | |---------|---------| | 模型提供商 | Claude (streaming), GPT, Gemini, Ollama, Mock | | Agent 工具 | shell, HTTP, 文件读/写/搜索, web 浏览器, GitHub, Jira | | 长期记忆 | SQLite 支持 —— agent 可跨会话记忆 | | 会话持久化 | 对话 + agent 配置在重启后保留 | | 工作流引擎 | 具有条件、重试、webhook 的多步骤自动化 | | Cron 调度器 | 按计划执行周期性 agent 任务 | | 流式传输 | Server-Sent Events 用于实时 token 交付 | ### 消息渠道 | Channel | Integration | |---------|------------| | Slack | Events API + chat.postMessage | | Microsoft Teams | Bot Framework activities | | WhatsApp | Cloud API webhook | | Telegram | Bot API webhook | | Discord | Interactions API | | Email | SMTP outbound + webhook inbound | | Webhook | 通用 HTTP POST | ### 安全与合规 | Feature | Details | |---------|---------| | 策略引擎 | YAML 规则 —— 按租户、agent、工具进行允许/拒绝/需要审批 | | RBAC | 4 个内置角色 + 拥有 11 项权限的自定义角色 | | 认证 | OIDC, JWT sessions, API keys | | 审计日志 | SHA-256 哈希链, Ed25519 签名, 每日轮换 | | 执行审批 | Human-in-the-loop (人机交互) 配合 approve/deny API | | 支出控制 | 按租户和按 agent 的预算限制 | | 速率限制 | 按租户的 token bucket | | 通知 | Slack webhook + 日志警报 | ### 企业版 | Feature | Details | |---------|---------| | 多租户 | 隔离的 agent、策略、审计、资源配额 | | 3 种隔离模式 | Namespace, Process, Docker container | | 联邦 | 点对点,具有策略同步和联邦审计查询 | | 数据驻留 | 按租户节点强制执行 | | 代理网关 | 具有 protocol-aware intent extraction 的反向代理 | | 配置迁移 | 版本化 schema 升级 | | 结构化日志 | 带有级别和模块上下文的 JSON 日志 | ## 架构 ``` ┌──────────────────────────────┐ │ CLI · Dashboard · REST API │ └──────────────┬───────────────┘ │ ┌──────────────▼───────────────┐ │ KERNEL │ │ IPC Bus · Config · Resources │ └──────────────┬───────────────┘ │ ┌────────┬────────┬────────┬────────┼────────┬────────┬────────┬────────┐ │ │ │ │ │ │ │ │ │ Policy Audit Agent Channel Proxy Skill Fed. Sched. Workflow Engine Logger Runtime Manager Gateway Runtime Module Module Engine ``` 每个组件都是一个 **kernel module**,通过具有背压功能的进程内 IPC 总线进行通信。模块按依赖顺序启动,并按相反顺序关闭。 ## 配置 ### cyntr.yaml ``` version: "1" listen: address: "127.0.0.1:8080" webui: ":7700" tenants: engineering: isolation: namespace finance: isolation: process ``` ### policy.yaml ``` rules: - name: allow-model-calls tenant: "*" action: model_call tool: "*" agent: "*" decision: allow priority: 10 - name: require-approval-shell tenant: "*" action: tool_call tool: shell_exec agent: "*" decision: require_approval priority: 20 ``` ### 环境变量 **LLM Providers** (至少需要一个): ``` ANTHROPIC_API_KEY=sk-ant-... OPENAI_API_KEY=sk-... GEMINI_API_KEY=... OLLAMA_URL=http://localhost:11434 ``` **Channels** (可选): ``` SLACK_BOT_TOKEN=xoxb-... TEAMS_APP_ID=... TELEGRAM_BOT_TOKEN=... DISCORD_BOT_TOKEN=... WHATSAPP_ACCESS_TOKEN=... EMAIL_SMTP_HOST=smtp.example.com ``` ## API 参考 所有端点均返回一致的 JSON 封装: ``` {"data": {...}, "meta": {"request_id": "...", "timestamp": "..."}, "error": null} ``` ### 系统 | Method | Endpoint | Description | |--------|----------|-------------| | GET | `/api/v1/system/health` | 模块健康状况 | | GET | `/api/v1/system/version` | 版本信息 | ### Agents | Method | Endpoint | Description | |--------|----------|-------------| | GET | `/api/v1/tenants` | 列出租户 | | POST | `/api/v1/tenants/{tid}/agents` | 创建 agent | | POST | `/api/v1/tenants/{tid}/agents/{name}/chat` | 聊天 | | GET | `/api/v1/tenants/{tid}/agents/{name}/stream` | SSE 流式传输 | ### 安全 | Method | Endpoint | Description | |--------|----------|-------------| | POST | `/api/v1/policies/test` | 策略检查试运行 | | GET | `/api/v1/approvals` | 待处理的审批 | | POST | `/api/v1/approvals/{id}/approve` | 批准 | | POST | `/api/v1/approvals/{id}/deny` | 拒绝 | ### Skills & Audit | Method | Endpoint | Description | |--------|----------|-------------| | GET | `/api/v1/skills` | 列出技能 | | POST | `/api/v1/skills/import/openclaw` | 导入技能 | | GET | `/api/v1/audit` | 查询审计日志 | ### Workflows & Federation | Method | Endpoint | Description | |--------|----------|-------------| | POST | `/api/v1/workflows` | 注册工作流 | | POST | `/api/v1/workflows/{id}/run` | 运行工作流 | | GET | `/api/v1/workflows/runs/{id}` | 运行状态 | | GET | `/api/v1/federation/peers` | 列出节点 | | POST | `/api/v1/federation/peers` | 加入节点 | ## 开发 ``` go test ./... -race # 505 tests, 32 packages go build -o cyntr ./cmd/cyntr go vet ./... ./cyntr doctor ``` ## 许可证 [Apache License 2.0](LICENSE) ## 贡献 参见 [CONTRIBUTING.md](CONTRIBUTING.md)

cyntr.dev · Releases · Issues

标签:AI安全, API网关, Chat Copilot, Claude, CVE检测, DevOps工具, EVTX分析, Gemini, GitHub集成, Go语言, GPT, LLM评估, LLM运维, Ollama, RAG基础设施, Slack集成, 企业AI平台, 单文件部署, 大模型管理, 安全合规, 审计日志, 工作流自动化, 开源, 政策引擎, 日志审计, 本地部署, 漏洞管理, 程序破解, 网络代理, 联邦架构, 自托管, 零依赖