Vault — Authentication
Secure management and automatic injection of API keys, tokens, and credentials.
Overview
The gateway manages API keys and tokens via a local vault file at ~/.elemm/vault.json. Credentials are automatically injected into outgoing requests based on the target API's hostname.
Vault File Format
{
"api.github.com": {
"type": "bearer",
"value": "ghp_your_personal_access_token"
},
"api.openweathermap.org": {
"type": "apiKey",
"name": "appid",
"in": "query",
"value": "your_api_key_here"
},
"custom.internal.api": {
"type": "apiKey",
"name": "X-Auth-Token",
"in": "header",
"value": "secret-123"
},
"legacy-service.com": {
"type": "basic",
"value": "dXNlcjpwYXNzd29yZA=="
}
}Supported Auth Types
| Type | Behavior |
|---|---|
apiKey | Injected as query parameter or header (controlled by the in field) |
bearer | Sets the Authorization: Bearer header |
basic | Sets the Authorization: Basic header |
| (string shorthand) | A plain string value is treated as apiKey with name: "key" in query |
Auth-Aware Validation
The gateway's pre-validation engine is vault-aware: if a required parameter (e.g., appid) is already provided by the vault, it will not be flagged as "missing" during local validation.
Auto-Reload
The vault is re-read from disk on every connect_to_site call. There is no need to restart the gateway after editing vault.json.
Missing Auth Warning
If the target API defines security schemes (in its OpenAPI spec) and no matching vault entry exists, the gateway emits a warning:
[WARNING]
AUTHENTICATION REQUIRED: This site requires apiKey.
REMEDY: Add an entry for 'api.example.com' to your ~/.elemm/vault.json.
INSTRUCTION: Inform the user that an API key is required for this service.DLP: Automatic Secret Redaction
When prevent_key_leakage: true (default) is set in the Security Policy, all vault API keys are automatically scrubbed from responses before they reach the agent. This prevents credentials from accidentally entering the LLM's context.
Deletion Protection
Before a credential is deleted in the dashboard, the backend checks whether the secret is currently referenced by a registered MCP server. If so, the deletion is refused to prevent runtime failures.