Credential Management
Every credential in an AgentShield deployment, where it lives, how it is protected, and how to rotate it.
An AgentShield deployment involves several kinds of credentials. This page inventories them and describes how each should be handled.
Inventory
| Credential | Held by | Stored by AgentShield as | Rotation |
|---|---|---|---|
| Agent Ed25519 seed | Agent process | Public key + SHA-256 fingerprint only | POST /api/v1/agents/{id}/credentials/rotate |
| Human password | Member | Argon2id hash | POST /api/v1/sessions/current/password |
| Session token | Browser (via dashboard cookie) or API client | SHA-256 | Expires in 12 h; sign-out revokes |
| Invitation token | Invitee's email | SHA-256 | Single use, 72 h; resend closes the previous link |
| Tool API credentials | Gateway environment | Not stored; injected per host | Update the environment variable and restart the gateway |
INTELLIGENCE_TOKEN | Gateway and analyzer environment | Not stored | Set the new value on both and restart |
DATABASE_URL | Each service | — | Rotate the database role password |
| Redis, NATS, MinIO credentials | Services | — | Rotate at the store; update services |
| SMTP credentials | Control plane (SMTP_URL) | — | Update and restart |
| Bootstrap password | Bootstrap command only | Argon2id hash of the owner | Change after first sign-in |
Agent seeds
- Generated by the agent operator. AgentShield never generates, receives, or stores them.
- Store them in a secret manager or a file readable only by the agent's service account.
- Use one seed per agent; never share a seed between workloads with different permissions.
- After a suspected leak, rotate immediately. Rotation takes effect on commit; the old key stops authenticating.
- To stop an agent without changing keys, suspend it.
Tool credentials stay in the gateway
The http.request tools file references environment variables by name:
{ "host": "api.github.com", "headers": { "Authorization": { "env": "AGENTSHIELD_GITHUB_AUTHORIZATION" } } }- The gateway reads the value at startup and refuses to start if it is empty or contains line breaks.
- The agent cannot read it, set it, or override it.
Host,Content-Length,Transfer-Encoding, andConnectioncannot be injected.- Responses never echo it: only a fixed set of response headers is returned.
On Kubernetes, provide these variables from a Secret, never from the ConfigMap that holds the tools file.
Human credentials
- There is no public registration route. The first owner comes from the bootstrap command, which refuses production mode.
- Passwords must be 12–128 characters and are stored as Argon2id.
- Changing a password ends the user's other sessions; disabling a member ends all of theirs.
- Temporary passwords, used when mail is not configured, are shown once and limit their session to changing the password.
Service credentials
| Setting | Production requirement |
|---|---|
DATABASE_URL | Must connect as agentshield_app for the gateway, control plane, and relay |
INTELLIGENCE_TOKEN | Required on the analyzer and the gateway; at least 32 characters |
INTELLIGENCE_URL | HTTPS unless the analyzer is on loopback |
NATS_URL | tls:// for a non-loopback server |
MINIO_USE_SSL | true for a non-loopback endpoint |
SMTP_URL | smtps:// or require_tls=true, with an HTTPS DASHBOARD_URL |
The services refuse to start when these requirements are not met.
Development defaults
.env.example and docker-compose.yml contain known development values: agentshield/agentshield for PostgreSQL, agentshield-dev-only for MinIO and Grafana, change-me-local-only for the bootstrap owner. Compose binds every port to 127.0.0.1. These are not credentials for any other environment.
Secrets in logs and errors
- Services never log request bodies or tool content.
- Error messages never include stack traces, SQL, or secret values.
- Redaction removes credential-like keys from stored arguments, results, and events.
- The intelligence engine never logs content and never quotes matched secrets.
Implementation references
Was this page helpful?
Prompt Injection Analysis
How AgentShield detects indirect prompt injection in tool results, warns the model, alerts operators, and why detection is advisory by design.
Auditability
The per-organization hash chain, append-only enforcement in PostgreSQL, audit head exports, verified evidence bundles, and how to verify the record.