API keys
Anima issues two types of API keys. Use the right key for each context.| Type | Prefix | What it can do | Best practice |
|---|---|---|---|
| Master Key | mk_ | Full access: create agents, manage billing, view logs | Store in server-only environment variables; rotate on a schedule |
| Agent Key | ak_ | Scoped access: send and receive for one specific agent | Issue one key per service; revoke unused keys immediately |
Content scanning
Every outbound message passes through a dual-layer scanner before delivery.- Regex layer — Fast, deterministic checks for known injection markers, secret patterns, and risky payload signatures.
- AI layer — GPT-4o-mini classifies content as
SAFE,SUSPICIOUS, orBLOCKED. - Fallback behavior — If AI credentials are unavailable, scanning continues in regex-only mode so your agents keep running.
Sensitivity levels
Adjust sensitivity to match your risk tolerance and message variability.| Level | When to use |
|---|---|
low | High-volume, well-structured automated messages with low risk of injection |
medium | Default. Balanced protection for most integrations |
high | Customer-facing or regulated contexts where false negatives are costly |
When content is blocked by policy, the API returns a denial response with a reason code. Use these codes to audit and tune your policies over time.
Content policies
The policy engine applies layered rules to outbound content. Rules are evaluated in priority order and can combine deterministic and model-based checks.| Rule type | What it does |
|---|---|
| Regex | Matches known dangerous patterns (e.g., prompt injection phrases) |
| AI | Enforces decisions based on model classification verdict |
| Domain | Whitelists or blacklists domains appearing in message content |
| Keyword | Detects finance, attachment, and social engineering signals |
AI scanning rate limits
AI scanning is rate-limited to 100 requests per minute. Results are cached using an LRU cache (1,000 entries, 5-minute TTL) to reduce redundant scans on repeated content. When the rate limit is reached, the scanner falls back to regex-only mode automatically.Webhook security
Anima signs every webhook payload with HMAC so you can verify that requests come from Anima and haven’t been tampered with. Follow these steps to verify incoming webhooks securely:Use a dedicated webhook secret
Generate a unique secret for each webhook endpoint. Do not reuse secrets across endpoints or environments.
Verify the HMAC signature
Compare the
X-Anima-Signature header against an HMAC-SHA256 digest of the raw request body using your secret.Use constant-time comparison
Compare signatures with a constant-time function to prevent timing attacks. Never use a plain equality check.
Operational best practices
Rotate keys on a schedule
Rotate keys on a schedule
Set a calendar reminder to rotate Master Keys at least quarterly. Agent Keys can be rotated more frequently if they are short-lived or service-specific. Anima supports issuing a new key before revoking the old one to avoid downtime.
Follow least-privilege access
Follow least-privilege access
Issue one Agent Key per downstream service. If a service is compromised, you can revoke just its key without affecting other integrations. Never use a Master Key where an Agent Key will do.
Review blocked events regularly
Review blocked events regularly
Check your blocked content events in the audit log on a regular cadence. Unexpected blocks may indicate a misconfigured policy or an active attack. Tune sensitivity levels and rules based on what you find.
Store secrets server-side only
Store secrets server-side only
Master Keys and webhook secrets must only exist in server-side code or a secrets manager. Never bundle them into client applications, browser code, or commit them to version control.
