Security
How ApiVault protects browser sessions, CLI access, and MCP connections.
In depth
- Encryption — the cipher, default and custom encryption modes, key derivation and re-encryption.
- Authentication — passkeys, TOTP, email codes, account-change confirmations and attempt limits.
Sessions & tokens
ApiVault uses four independent credential types. Revoking one does not affect the others:
| Credential | Used by | Revoke via |
|---|---|---|
| Browser session | Web dashboard, settings | Settings → Sessions & Devices, or sign out |
| CLI token | apivault commands | apivault logout or Settings → Sessions & Devices |
| MCP OAuth token | Cursor, Claude, MCP clients | Settings → MCP Connections |
| Service token | Pipelines, containers, REST API | The project's Service Tokens page |
CLI tokens expire after 90 days. Check the expiry in Settings → Sessions & Devices and run apivault login to reconnect.
Browser request protections
Cookie-authenticated state-changing requests are restricted to the app's own origin. CLI and MCP integrations use bearer tokens instead, so they do not depend on browser cookies or cross-site request behavior.
Anonymous CLI connection requests are limited to five per source address per ten-minute window.
Content Security Policy
Each page response has a fresh nonce that authorizes its scripts. This blocks scripts injected through stored content, such as a project name or key note. strict-dynamic extends trust to scripts loaded by authorized scripts.
ApiVault renders pages per request to generate the nonce. It also sets Strict-Transport-Security, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, and a Permissions-Policy that blocks camera, microphone, and geolocation access.
CLI security
The CLI signs in through browser approval and stores its token in the operating system's credential store when available. See CLI security and service token security.
MCP security
Agents get only the OAuth scopes you approve, through short-lived tokens that work on the MCP server alone, and each client can be revoked separately. See MCP security practices.
Best practices
- Add
.env,.env.local, and any exported dotenv files to.gitignore - Keep
~/.apivault/, tokens, and vault keys out of Git - Use custom encryption mode for sensitive projects, so ApiVault keeps no recoverable copy of the key that decrypts them
- Enable 2FA and passkeys on your account
- Review and revoke stale CLI and MCP connections periodically
- Use
apivault runinstead of exporting secrets to disk when possible - Do not paste raw secrets into chat, commits, logs, or issue trackers
- Request minimum MCP scopes for AI agents
Reporting a vulnerability
Report vulnerabilities privately by emailing support@apivault.tech with the subject “Security report”. We acknowledge reports within 48 hours and send an assessment within five business days. See the disclosure policy for scope and what to include.