Purpose
Provide enterprise teams a repeatable, auditable way to build, test, and promote assistant and squad configurations across environments.
Audience
- Platform admins: environment boundaries, access control, and compliance
- DevOps/Eng: CI/CD and automation
- Forward-deployed engineers: day-to-day configuration and migrations
Principles
- Isolation: Separate organizations per environment:
dev, uat (or staging), prod.
- Config as Code: Store assistant/squad/tool/knowledge-base configs as JSON/YAML in Git.
- Immutability + Promotion: Create in
dev, validate in uat, promote to prod via automation.
- Least privilege: RBAC, secrets isolation, and data boundaries per environment.
- Reproducibility: Idempotent apply, drift detection, and rollbacks from Git history.
Environment topology
- Organizations: One org per environment, e.g.,
acme-dev, acme-uat, acme-prod.
- Networking & data:
dev: synthetic or scrubbed data
uat: production-like data, avoid real PII when possible
prod: real data with strict logging/audit
- Access:
dev: engineers only
uat: QA, SMEs
prod: restricted operators; changes via CI/CD only
Resources under management
Treat these as declarative resources:
- Assistants: system prompt, tools, routing, grounding, safety settings
- Squads/Teams: membership and permissions
- Tools/Integrations: function schemas, external service configs
- Knowledge Bases: document sources, embedding settings
- Runtimes/Policies: rate limits, safety policies, fallback models
Reference resources by stable logical names (slugs) in config; resolve to IDs at apply time.
Repository structure (example)
Do not commit secrets. Store them in your secret manager (e.g., Vault, AWS Secrets Manager, GCP Secret Manager) and reference via placeholders.
- Develop in DEV
- Create/modify configs in Git.
- Run local validation (schema/lint) and a plan/diff against
dev.
- Apply to
dev; run unit/integration tests and data access checks.
- Promote to UAT
- Open a PR; CI runs
plan against uat and posts a diff.
- On approval, CI applies to
uat using a service principal for the uat org.
- Promote to PROD
- Change window + ticket if required.
- CI runs
plan against prod, requires approvals from owners.
- CI applies to
prod; record the change set and artifacts.
- Rollback
- Revert Git commit → CI reapplies previous config (idempotent).
- Keep backup exports from each apply job for audit.
Applying configs via API
Use a small deployer that:
- Reads YAML/JSON
- Resolves references and secrets for the target environment
- Translates to API payloads
- Uses idempotency keys and labels to detect drift
Example pseudo-commands:
Recommendations:
- Idempotency: One key per resource per pipeline run
- Labeling: Tag resources with
env, app, owner, sha for traceability
- Drift: Fetch current → compute diff → fail pipeline on unmanaged drift
CI/CD example (GitHub Actions)
Naming and referencing
- Use unique slugs (e.g.,
order-agent) per environment
- Prefer logical refs in specs; map to environment-specific IDs at render/apply time
- Save Git commit SHA as a label on each resource for traceability
Security and compliance
- RBAC: Developers write to
dev, read uat, no direct prod writes; CI principals per org
- Secrets: Keep out of Git. Resolve via
secrets://path at apply time; rotate per policy
- Audit: Keep apply logs, request/response checksums, and exported snapshots per run; enable API audit logs in each org
Testing and validation
- Static: JSONSchema validation; lint refs and schema compatibility
- Dynamic: Dry-run/plan renders and diffs
- Behavioral: Golden-path chat transcripts in
dev and uat; tool execution smoke tests; canary in prod
Operational runbooks
- Create a new assistant: add YAML → PR → CI plans → approve → deploy to
uat → UAT signoff → deploy to prod
- Change a tool: update tool YAML; bump assistant
spec.tools; ensure backward compatibility; run smoke tests
- Incident rollback: revert commit; re-run apply; confirm labels reverted
FAQ
- How do we copy an assistant to another environment? Export from source org (GET), normalize to YAML/JSON, check into Git, then apply to target org via CI using the deployer.
- What exactly is the “config”? The full API payload needed to create/update the assistant, its referenced tools, knowledge bases, and policies. Store it declaratively and resolve environment-specific references at apply time.
- We don’t have built-in versioning yet. What should we do now? Use Git as the source of truth, add labels with commit SHAs to resources, and require CI-only writes to
prod.
- How do we handle environment-specific differences (models, endpoints)? Parameterize via
environments.yaml and templates; keep the logical spec identical across envs, only vary parameters.
- Config: validated and reviewed
- Secrets: present in target environment
- Diff: plan shows expected changes only
- Tests: UAT signoff recorded
- Approvals: change ticket and reviewers complete
- Backups: exported current
prod state saved
- Monitoring: alerts enabled for error rate and tool failures
Minimal example: render + apply (Node)