Security & Secrets Management
Relevant source files
The following files were used as context for generating this wiki page:
Security and Secrets Management in oboete protects sensitive information through automated redaction, isolated key storage, and gated access controls. The system ensures that API keys and personal credentials do not enter the long-term memory of coding agents or leave the local environment during provider calls.
API Key Management
oboete enforces strict rules for handling API keys to prevent accidental exposure or unauthorized usage by subprocesses.
- You store API keys in
~/<NAME>_KEY.mdfiles. - The system reads the token from the second line of these files.
- The software never prints keys to the console or logs.
- The system prevents passing keys to subprocess environments.
Sources: CLAUDE.md:27-28
Redaction and Gating
The redaction system, known as the "egress gate," filters all outgoing text to mask secrets using regex-based rules.
Redaction Rules
oboete uses a comprehensive set of rules to identify secrets. It combines a default gitleaks.toml configuration with custom project-specific rules in oboete-rules.toml.
| Rule Type | Source | Description |
|---|---|---|
| Global Rules | config/gitleaks.toml | Standard patterns for AWS, GitHub, Slack, and other common services. |
| Custom Rules | config/oboete-rules.toml | Patterns for specific AI providers (Groq, Anthropic, OpenRouter) and credential headers. |
| Dynamic Rules | src/curate.rs | Rules added after storage that still apply to historical data during retrieval. |
Sources: config/gitleaks.toml:1-10, config/oboete-rules.toml:1-5, src/curate.rs:188-189
Redaction Workflow
The following diagram illustrates how data flows through the egress gate before reaching a model or the UI.
The egress gate applies rules to the whole body of a document before any snippets are cut, ensuring that secrets are not exposed even if the context lies outside the visible range.
Sources: src/mcp.rs:69-70, src/curate.rs:434-436
Data Isolation and Access Control
oboete implements several layers of isolation to protect the integrity and privacy of the stored memory.
Viewer Authentication
The oboete view web interface uses token-based authentication to prevent unauthorized local access.
- The viewer generates a unique access key when started.
- The client-side application extracts this token from the URL hash (
#t=...). - All API requests must include the
X-Oboete-Tokenheader. - The server returns a
401 Unauthorizederror if the token is missing or incorrect.
Sources: assets/viewer/app.js:4-24
Isolation Gates
Specific gates prevent certain types of data from being processed by curators or external tools.
- Memory Read Protection: The system identifies tool calls that attempt to read oboete's own memory (e.g.,
mcp:search,oboete get). It shows the call but masks the output to prevent recursive memory loops or exposure of retracted items. - Binary Content: Capture markers for binary content (images, etc.) are stripped before text reaches a curator.
- Private Blocks: Users can mark text as
<private>to exclude it from specific processing stages.
Sources: src/curate.rs:253-260, src/curate.rs:240-245, src/curate.rs:1367-1370
Implementation Details
Redaction Logic
The system uses the redact module to perform part-based and range-based redaction.
// Example of range-based redaction from src/curate.rs
let gate = |r: std::ops::Range<usize>| {
crate::redact::outbound_range(long, r, hidden.as_deref(), self.rules)
};
Sources: src/curate.rs:434-436
Custom Provider Rules
Specific AI provider keys are matched using dedicated regex patterns to ensure they are captured reliably.
| Provider | Key Prefix | Pattern Detail |
|---|---|---|
| Groq | gsk_ | \b(gsk_[A-Za-z0-9]{40,64})\b |
| Anthropic | sk-ant- | \b(sk-ant-[A-Za-z0-9_-]{40,200})\b |
| OpenRouter | sk-or-v1- | \b(sk-or-v1-[a-f0-9]{48,96})\b |
Sources: config/oboete-rules.toml:5-18
Summary
oboete maintains a secure local memory by combining strict file-based key management with an automated redaction system. By using standardized gitleaks rules and custom egress gates, the project ensures that sensitive credentials remain private while still allowing AI agents to access helpful long-term context. All data leaving the local environment or appearing in the viewer interface passes through a final redaction layer.