Vault Secrets & Automatic Redaction
Leases short-lived API keys into memory only and scrubs them out of every prompt, log, and output.
An API key accidentally printed in an error stack trace gets sent straight to the LLM and saved in logs.
Secrets stay out of the database and are automatically replaced with [REDACTED] before the model or user sees them.
What It Does (In Plain English)
Secrets fetches credentials from your vault (vault-env locally, vault-openbao in Enterprise) into RAM only — never writing secret values to the database. It automatically scrubs leased values (and common key patterns) from model contexts, tool outputs, traces, artifacts, and user replies.
Real-World Example
- 1Connector leases
ERP_API_KEYfrom the vault for a single call. - 2The upstream server returns an error echoing the bearer header.
- 3Secrets catches the exact leased value and scrubs it before the result reaches the LLM or logs.
When Should You Turn It On?
Required automatically at Level 1 (review) and above.
Safety level note: Level 1 · Review — Read-only. Can inspect and answer, never changes outside systems.
How to Add It (workspace.yaml)
kits:
- "@neusym/kit-secrets@0.1.0"
kitConfigs:
secrets:
redactBuiltInPatterns: trueKits It Works With
Technical Details & Configuration Options (5 settings)
| Package | @neusym/kit-secrets |
|---|---|
| Provides Ports | secrets@1 |
| Requires Ports | vault@1 |
| Optional Ports | None |
| Publishes Events | None |
| Owned DB Collections | credential_refs |
Configuration Options (kitConfigs.secrets)
| Setting | Type | Default | Description |
|---|---|---|---|
defaultLeaseTtlSeconds | integer | 60 | — |
warmCacheTtlMs | integer | 30000 | How long a process caches a tenant's static secret warm-up before re-reading credential_refs and vault values (0 refreshes on every check). |
allowedVaultKeys | array | — | Vault keys a credential ref may name: exact keys, or prefixes ending in '*'. '{tenantId}' in an entry stands for the tenant registering or leasing the ref (for example 'tenants/{tenantId}/*'), so each tenant names only its own keys; a tenant id holding '*' or the character after '{tenantId}' matches no such entry, and a prefix entry needs a separator before its '*' (INVALID_VAULT_KEY_PATTERN). When set, registering or leasing any other key is refused (VAULT_KEY_NOT_ALLOWED). Unset, any key is allowed: a workspace serving several tenants should set it, since the vault itself is not tenant-aware. |
redactBuiltInPatterns | boolean | true | When true (default), redacts and blocks high-confidence secret formats (PEM private keys, cloud access key IDs, structured provider tokens) in addition to vault-leased values. |
redactPatterns | array | — | Additional ECMAScript regular expression patterns whose matches are redacted and blocked as secrets across context, logs, and outputs. |