Backup and Recovery
What to back up, how to restore AgentShield without breaking the audit chain, and how to recover from data store failures.
What to back up
| Data | Criticality | How |
|---|---|---|
| PostgreSQL | Critical. Identities, policies, decisions, approvals, audit chain, outbox | Continuous archiving (WAL) plus periodic base backups, or your provider's point-in-time recovery |
| Object storage (evidence) | High for investigations | Bucket versioning or replication; object lock for tamper resistance |
| Audit head exports | High: your out-of-band integrity reference | Copy each export's sequence and head_hash to a separate system |
| Configuration | High | Version the tools file, Kustomize overlays, and environment in source control; keep Secrets in your secret manager |
| Redis | Not required | Ephemeral nonces, counters, and circuits |
| NATS JetStream | Not required for correctness | Events are re-derivable from PostgreSQL while they are in the outbox; published events are retained seven days |
Agent seeds are not held by AgentShield. Agent operators back them up, or simply rotate after a loss.
Restoring PostgreSQL
- Stop the gateway, control plane, and relay so nothing writes during the restore.
- Restore the database to the chosen point in time.
- Verify the audit chain against your most recent external head exports at or before that point. See Auditability.
- Start services and confirm readiness.
After a point-in-time restore:
- Decisions, executions, and events after the restore point are gone. Side effects that happened in external systems during that window are not reversed; reconcile them from your tool providers' logs.
- An execution claimed before the restore point but completed after it reappears as dispatched without an outcome. The gateway refuses to run it again (
409), which is the safe behavior. - Approvals decided after the restore point must be decided again.
Redis loss
Losing Redis resets nonce reservations, budgets, and circuits. The gateway's readiness returns to 200 as soon as Redis answers again. For the following 60 seconds, a request captured shortly before the loss could be replayed once, because its timestamp is still valid and its nonce is no longer reserved. Use Redis persistence or replication if that window matters to you.
Relay or NATS loss
Events remain in event_outbox until JetStream acknowledges them. When the relay or NATS returns, the backlog drains in order. If the JetStream stream itself is lost, events already deleted from the outbox are not republished; they remain in security_events and the audit chain.
Object storage loss
Evidence rows in PostgreSQL keep each bundle's SHA-256. Restored objects that match are served normally; missing or altered objects are refused by the control plane with an integrity error. The underlying records the bundles were built from remain in PostgreSQL.
Recovery drills
- Restore a backup to a separate environment quarterly and verify the audit chain against exported heads.
- Run the chaos catalog against the restored environment to confirm the gateway still fails closed.
Was this page helpful?
Scaling Considerations
How each AgentShield component scales, where contention appears, and how budgets and per-organization serialization affect throughput.
Dashboard
The AgentShield operations console. Sections, role-aware access, approvals, agent lifecycle, policies, alerts, evidence, and how the console protects sessions.