Security
Built-in safeguards to protect your agents, users, and outbound communications.API Keys
Two types: Master Keys (full admin access) and Agent Keys (scoped to a single mailbox).Dual-Layer Content Scanning
Scans with both deterministic regex heuristics and AI classification.API Key Types
Reaching master authority
AMASTER_KEY_REQUIRED (403) means the operation needs org-admin authority and the credential you used does not carry it — around a hundred endpoints sit behind that gate, including agent creation, key management, billing, and the event stream. Which route out is open depends on how you authenticated:
Admin access from the CLI
There is no command to run first. A command that needs admin rights —anima agent create, key rotation, anima tail — asks for it itself, and your OS prompts for your login password.
The first time on a given machine, the CLI emails a code to the organization owner and enrols that machine inline, at the moment you need it. Enrolment stores a grant in the OS keychain behind a human-presence gate, so later commands need only the password prompt rather than another email.
Admin access lasts for the single command that asked for it and is never written to disk, so each admin command prompts.
An agent driving the CLI holds your API key and can run every command, but it cannot answer a system password dialog. That is the boundary, and it is deliberate. The gate is local: it governs release of the grant on this machine, and the server cannot verify that a human was present — so treat it as narrowing who can obtain admin authority here, not as a guarantee about what that authority can do once obtained.
Content Scanning Overview (Regex + AI)
- Regex Layer: Fast checks for known injection markers, secret patterns, and risky payload signatures.
- AI Layer: GPT-4o-mini classification into
SAFE,SUSPICIOUS, orBLOCKED. - Fallback Safety: If AI credentials are missing, scanning gracefully continues in regex-only mode.
Note: Uselow,medium(default), orhighsensitivity depending on risk tolerance and expected message variability.
Content Policy Configuration
The policy engine applies layered rules to outbound content and can combine deterministic and model-based checks.- Regex rules: Match known dangerous patterns.
- AI rules: Enforce decisions based on model classification.
- Domain rules: Whitelist or blacklist domains in message content.
- Keyword rules: Detect finance, attachment, and social engineering signals.
Agent Capability Policies
Separate from content scanning: each agent carries an optional capability policy — hard limits an org admin sets on what the agent may do, regardless of message content. Read it withGET /v1/agents/{agentId}/policy (any key in the org). Write it with PUT /v1/agents/{agentId}/policy (master key only):
Every section is optional — omit one to leave that channel unrestricted. Validation is strict: unknown fields are rejected with a
400 rather than silently ignored, so typos can’t create a policy that looks stricter than it is.
An email send that violates the policy is refused and logged as a security event, so blocked attempts show up in the audit trail.
Note: Email constraints are enforced on every send today. Vault and phone constraints are validated and stored, but not yet enforced at request time.
Rate Limiting for AI Scanning
AI scanning is rate limited to 100 req/min, uses an LRU cache with 1000 entries and a 5min TTL, and falls back to regex scanning when needed.Attachment Scanning
Email attachments are scanned both when an agent receives them and before an agent sends them, so malicious files are caught in either direction.- Magic-byte detection: the actual leading bytes are inspected, not the declared type or the file extension (both are trivially spoofed). An executable or script disguised as
invoice.pdfis unmasked and blocked. - Content scanning: text attachments run through the same content scanner as message bodies, catching leaked credentials, PII, and risky file types.
- Verdict: each attachment gets a
scanStatusofCLEAN,FLAGGED, orBLOCKED, surfaced in the message’s attachment metadata so an agent can decide before fetching the bytes.
BLOCKED attachment cannot be downloaded — the download endpoint returns 403. Download URLs are short-lived (15 minutes) and scoped to the requesting agent.
Webhook Security (HMAC Verification)
Webhook payloads are protected with HMAC verification and freshness checks to prevent tampering and replay attacks.- Use a dedicated webhook secret.
- Verify the HMAC signature on every request.
- Compare signatures using constant-time comparison.
- Reject requests that fail timestamp freshness checks.
Warning: If content is blocked by policy, the API returns a denial response with a reason code so you can audit and tune policy behavior safely.
Operational Best Practices
- Rotate keys on a regular schedule.
- Store master keys only in server-side environments.
- Use least-privilege agent keys per service.
- Review blocked events and adjust policies carefully.
