01
Apply strict least-privilege permissions
Give the agent access only to the exact endpoints and database tables its job requires. If an agent triages tickets, it gets read-only access to customer messages. It doesn't get billing access or organization-wide API tokens.
02
Enforce human-in-the-loop on high-consequence actions
Configure hard system stops on irreversible operations. Sending external emails, altering production tables, issuing refunds, changing permissions, and deploying code must require authenticated human approval.
03
Separate read and write database credentials
Split database connections into distinct service accounts. Information-retrieval agents should connect through read-only replicas, eliminating the possibility of accidental table drops or corrupted records.
04
Sanitize external inputs before context ingestion
Treat customer emails, web pages, and uploaded files as adversarial data. Strip executable scripts, validate character lengths, and use dedicated classifier models to check for prompt injection before data enters the agent's context.
05
Validate tool outputs before subsequent calls
Don't let an agent pass raw tool outputs straight into its next reasoning step. Enforce strict JSON schema validation on every API response so malformed or unexpected data halts the loop immediately.
06
Maintain append-only audit logs
Record every incoming prompt, model reasoning step, tool call, parameter set, database query, approval event, and returned response. Store these in immutable logs for compliance audits and incident post-mortems.
07
Run real-time anomaly detection
Set alert triggers on unusual agent metrics: spikes in tool calls per minute, unexpected database table access, calls outside business hours, or attempts to access endpoints outside the agent's baseline profile.
08
Isolate credentials in dedicated secret vaults
Never hardcode API keys in prompt templates, context buffers, or source code. Store credentials in AWS Secrets Manager or HashiCorp Vault, inject them at the gateway layer, and rotate them automatically.
09
Configure rate limits and budget caps
Put hard circuit breakers on execution loops: limit sessions to 10 tool calls, cap financial operations at $100 per transaction, and throttle hourly token budgets to prevent runaway spend.
10
Build an instant emergency kill switch
Engineers and security teams must have a one-click mechanism to revoke agent tokens, pause running workflows, and disable webhooks without redeploying backend infrastructure.