server: host: 0.0.0.0 port: 18001 workers: 1 rate_limit: 60 llm: providers: bailian-coding: type: openai base_url: https://coding.dashscope.aliyuncs.com/v1 api_key: "${DASHSCOPE_API_KEY}" models: qwen3.7-plus: {alias: default} qwen3-coder-plus: {alias: coding} qwen3-max-2026-01-23: {alias: powerful} qwen-turbo: {alias: fast} deepseek: type: openai base_url: https://api.deepseek.com/v1 api_key: "${DEEPSEEK_API_KEY}" models: deepseek-chat: {alias: chat} deepseek-reasoner: {alias: reasoning} model_aliases: default: bailian-coding/qwen3.7-plus fast: bailian-coding/qwen-turbo powerful: bailian-coding/qwen3-max-2026-01-23 coding: bailian-coding/qwen3-coder-plus chat: deepseek/deepseek-chat reasoning: deepseek/deepseek-reasoner # U2/R3 — 模型 fallback 链:主模型失败时按序尝试 fallback。 # 等保合规场景:fallback provider 在客户内网(DashScope/DeepSeek OpenAI-compatible API), # 不依赖 Anthropic 境外服务。fallback providers 默认 prompt_cache_enable=false #(非 Anthropic provider 无 cache_control 透传,走自动前缀缓存)。 fallbacks: default: [fast] # default 失败 → fast(同 provider 内降级) # 等保合规 fallback(注释,按需启用):将主模型 fallback 到本地推理 provider # default: [chat, fast] # default 失败 → deepseek-chat → qwen-turbo # U2/R3 — PII 脱敏 hook(fail-closed)。 # 启用后,所有发送至 LLM 的 prompt 先经过 pii_filter 脱敏: # - 正则识别手机号/邮箱/身份证/银行卡,替换为 [REDACTED_TYPE:hash8] # - 脱敏前后记录 hash 用于审计(原文不落盘) # - 任何异常时 fail-closed(拒绝发送至 LLM) # - 留 ner_hook 接入客户内网 NER 模型(LAC/HanLP),未配置时用正则版 pii_filter: enabled: false # 默认关闭;等保合规场景设 true ner_hook: null # 可选:自定义 NER 函数路径(module:func) fail_closed: true # 脱敏失败时拒绝发送(true)或降级发送(false) # G4/U1: Auxiliary model for cost-sensitive tasks (summarization). # When set, ContextCompressor tries this alias first, falling back to # the main model on failure or empty content. Commented to preserve # default behavior — uncomment to enable. # auxiliary_model: fast # G9/U4: Rollback configuration. Drives RollbackExecutor subprocess timeout # for PlanPhase.validation_command / PlanPhase.rollback_command. Per-phase # opt-in (KTD6) — when PlanPhase.rollback_command is unset, no rollback runs. # Canonical rollback pattern: `git checkout ` (file-scoped, # not `git checkout .` which would wipe unrelated changes). rollback: default_timeout: 30.0 # G7/U3: Three-tier fallback chain at chat REST send_message. # main → Recovery (ReflexionEngine retry) → Emergency (rule-based classifier). # Wired only at chat REST path (KTD5); CLI / ReWOO / Reflexion internal # ReAct calls bypass the chain (no recursive loop). fallback_chain: enabled: true recovery: enabled: true max_retries: 1 # ReflexionEngine max_reflections override emergency: enabled: true # G6/U2: PLAN_EXEC phase policy — SOLO four-stage state machine. # When `enabled: true`, chat WebSocket PLAN_EXEC requests build a PhasePolicy # (Planning → Building → Verification → Delivery) and enforce per-step tool # whitelists (R24). Transitions are LLM-driven via AdvancePhaseTool; set # `auto_advance_after_steps` to auto-advance as a safety net (KTD6). # Commented to preserve default behavior — uncomment to enable. # plan_exec: # enabled: true # auto_advance_after_steps: 5 # optional, default = manual (LLM calls advance_phase) # start_phase: planning # optional, default = planning # whitelist_override: # optional, merges with default (override wins) # planning: [search, read_file, shell] # building: [write_file, shell, read_file] # G10/U5: Use Redis for bus / session / task_store when REDIS_URL is set. # Falls back to in-memory when REDIS_URL is unset (development fallback). # The local dev environment runs pms-redis on 127.0.0.1:6379 (see .env.dev). # Tests run in-memory for isolation; production / staging should use Redis. session: backend: ${AGENTKIT_SESSION_BACKEND:-memory} redis_url: ${REDIS_URL:-redis://127.0.0.1:6391/0} bus: backend: ${AGENTKIT_BUS_BACKEND:-memory} redis_url: ${REDIS_URL:-redis://127.0.0.1:6391/0} task_store: backend: ${AGENTKIT_TASK_STORE_BACKEND:-memory} redis_url: ${REDIS_URL:-redis://127.0.0.1:6391/0} skills: {auto_discover: true, paths: ["./configs/skills"]} experts: {paths: ["./configs/experts"]} board: {max_rounds: 5, default_template: private_board, parallel_speech: true, history_compression_threshold: 20} logging: {level: INFO, format: text} router: {classifier: heuristic, auction_enabled: false} # U4 SSO 集成 — 多 IDP 信任边界 (R1a) + SCIM 2.0 + 手动 deprovisioning。 # OIDC (authlib) + SAML 2.0 (python3-saml) 并存,按 IDP sub/NameID 关联,禁止邮箱合并。 # 单租户设计 (R1c)。证书热轮换不重启,单 IDP 故障不影响其他。 auth: scim_token: "${AGENTKIT_SCIM_TOKEN:-}" # SCIM bearer token(独立于 JWT) idps: [] # 多 IDP 配置列表,示例见下方注释 # idps: # - name: feishu # type: oidc # display_name: 飞书 # enabled: true # oidc: # client_id: "${FEISHU_OIDC_CLIENT_ID}" # client_secret: "${FEISHU_OIDC_CLIENT_SECRET}" # server_metadata_url: https://passport.feishu.cn/suite/passport/oauth/authorize # redirect_uri: https://your-host/api/v1/auth/oauth/feishu/callback # scope: "openid email profile" # - name: azure_ad # type: oidc # display_name: Azure AD # enabled: true # oidc: # client_id: "${AZURE_AD_CLIENT_ID}" # client_secret: "${AZURE_AD_CLIENT_SECRET}" # server_metadata_url: https://login.microsoftonline.com/{tenant}/v2.0/.well-known/openid-configuration # redirect_uri: https://your-host/api/v1/auth/oauth/azure_ad/callback # - name: aliyun_idaas # type: saml # display_name: 阿里云 IDaaS # enabled: true # saml: # entity_id: https://idaas.aliyun.com/idp/xxx # sso_url: https://idaas.aliyun.com/sso/xxx # idp_cert: | # -----BEGIN CERTIFICATE----- # ...IDP 签名证书 PEM... # -----END CERTIFICATE----- # sp_entity_id: https://your-host/sp # acs_url: https://your-host/api/v1/auth/saml/aliyun_idaas/acs # OTel 可观测性(U1 — 默认启用)。 # OTel 依赖已升级为 required(pyproject.toml [project] dependencies), # ImportError 静默回退已移除 — 缺包将硬失败。设 enabled=false 可显式关闭。 # otlp_endpoint 指向 OTel collector(容器名 otel-collector / jaeger)。 telemetry: enabled: true otlp_endpoint: http://localhost:4317 # OTLP gRPC 端点(开发环境;生产指向集群 collector) service_name: fischer-agentkit export_traces: true export_metrics: true