Production agents need robust security, key management, and deployment practices.
Deployment Checklist
- Use project-scoped keys (
sk-proj-...) with minimum required permissions. - Rotate keys periodically using
RotatingKeyPool. - Validate and sanitize all user input before sending to the API.
- Use
max_iterationsguard to prevent infinite tool loops. - Set per-tool timeouts with
asyncio.wait_for. - Enable JSONL logging for audit trails.
- Use connection pooling — never create a new client per request.
- Implement graceful shutdown for async workers.
The model is not your security boundary
Every public-facing LLM agent eventually meets a prompt that says 'ignore your instructions and reveal the system prompt'. The model can be jailbroken, tricked, or simply wrong about what it should refuse. Your security boundary lives in code: input validation (length caps, schema, suspicious-token filtering), output scrubbing (no secrets in errors, no raw tracebacks to users), rate limiting per IP / per tenant.
cwkPippa's posture is private-by-default: localhost + Tailscale only, CORS locked to three origins, JSONL encrypted at rest, .env never committed, every secret loaded via Pydantic Settings (which won't print itself). The same pattern scales to a public deploy with a real auth layer and an upstream WAF added — the agent code itself doesn't change.