Credential Vault
Detects and redacts API keys, passwords, tokens, and personal information in conversations.
What It Does
Sensitive information ends up in AI conversations more often than you'd think -- pasted from config files, included in error logs, or even generated by the AI itself. Credential Vault scans both incoming and outgoing messages, looking for things that look like secrets: API keys, passwords, private keys, database connection strings, and more.
When it finds something sensitive, it replaces it with [REDACTED_BY_CRABSHIELD] so the information never makes it into logs or the agent's memory. The guard also scans for PII (personally identifiable information — data that can identify a person) like credit card numbers, social security numbers, email addresses, and phone numbers. Think of it as an always-on filter that catches secrets before they can leak.
The guard goes beyond obvious matches -- it also checks for encoded content and statistically unusual strings that have the characteristics of randomly generated secrets, even if they don't match a known format.
Why It Matters
Data leaks are one of the highest-impact security incidents. A single exposed API key or database password can give an attacker access to your entire infrastructure. This guard is especially important for agents that interact with code, configuration files, or external services -- and it's essential in regulated environments where credential or PII exposure creates compliance risk.
What Gets Caught
The guard recognizes many common credential formats, including:
- API keys — AWS access keys, GitHub tokens, GitLab tokens, Slack tokens, and generic key formats (
sk_,pk_,api_key_prefixes) - Passwords and secrets — values assigned to fields like
password=,secret=,token=in code or config snippets - Private keys — PEM-formatted RSA, EC, and SSH private keys
- Connection strings — database URLs with embedded credentials (
postgres://user:pass@host,mongodb://, etc.) - Tokens — JWTs and bearer tokens
- Personal information — credit card numbers, social security numbers, email addresses, and phone numbers (when PII scanning is enabled)
The guard also detects credentials hidden inside Base64-encoded strings and high-entropy strings that look like they might be secrets.
What won't trigger it: Mentioning the word "password" in conversation ("the password field is required"), discussing credential types in the abstract, or referencing key formats without actual credential values. If you're getting false positives on a specific pattern, use a suppression rather than disabling the guard.
Example
A user pastes a configuration snippet into the chat that contains AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY. Credential Vault detects the AWS key pattern, and the message is delivered to the agent with the key replaced by [REDACTED_BY_CRABSHIELD]. The user and agent can continue the conversation normally, but the actual credential never enters the agent's memory or logs. The audit log records the detection with the credential type identified.
Settings
These settings are available in the CrabShack dashboard under your agent's security configuration.
| Setting | What It Controls |
|---|---|
| Scan Outputs | Whether to scan AI-generated responses (not just user input) |
| Redact Transcripts | Whether to replace detected credentials with [REDACTED] in logs |
| PII Scanning | Whether to scan for personal information (credit cards, SSNs, etc.) |
| Custom Patterns | Add patterns for organization-specific credential formats |
| Exemptions | Skip scanning for specific trusted contexts |
How It Responds
Detected credentials are automatically redacted from both messages and logs. There's no block/warn mode -- redaction happens transparently. The conversation continues normally, but the sensitive content is replaced before it's stored or processed further.
If This Guard Blocks You
-
Check the audit log. Navigate to Security > Audit Log in the CrabShack dashboard. Filter by Credential Vault to find the relevant event. Click on the event row to expand it and see details including which skill and channel triggered it, the session key, and additional context.
-
Understand the detection. The audit log shows what type of credential was detected — API key, password, private key, connection string, or PII (personally identifiable information — data that can identify a person, such as credit card numbers or email addresses). If the detection is correct, the guard is working as intended — the credential was safely redacted. If it's a false positive (for example, a string that matches an API key pattern but isn't actually a credential), create a suppression for that detection label. If a specific channel routinely handles data that triggers this guard (like an internal analytics channel), consider creating an exemption for that channel.
-
Adjust if needed. Create a suppression for specific false-positive detection labels. Create an exemption for channels that legitimately handle credential-like data. This guard always redacts — there's no warn-only mode. See the Configuration page for details.
Prefer creating a targeted exemption for a specific skill or channel over disabling the guard entirely. If you're seeing frequent false positives, a suppression lets you silence a specific detection label temporarily while you refine your settings.
Default Behavior
All scanning is enabled out of the box. Credentials are redacted in both input and output messages. PII scanning is active. No changes occur during lockdown because the guard's default behavior is already comprehensive.
Related Guards
- System Prompt Leakage -- detects credentials embedded in system prompts at startup.
- Filesystem Fence -- blocks reads of
.envfiles, complementing the credential detection here.