Secrets are exposed to plugins and subprocesses via environment variables #50
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Competitor
Kind/Documentation
Kind/Enhancement
Kind/Epic
Kind/Feature
Kind/Security
Kind/Story
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Scope/Core
Scope/Cross-Plugin
Scope/Plugin-System
Scope/Single-Plugin
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ultanio/cobot#50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Cobot currently has no secret management. Credentials (API keys, bot tokens, wallet keys) live in environment variables or config files and are accessible to:
os.environ["TELEGRAM_BOT_TOKEN"]or any other secret, regardless of whether it needs itexeccalls, shell tools, and scripts inherit the full environment including all secretsThis means a single misbehaving plugin, a prompt injection that triggers a tool call, or even a careless
envcommand can leak every credential the agent has.What we want
Prior art
Impact
Without this, cobot cannot safely:
Proposed spec:
vaultplugin1. New
PluginMeta.secretsfieldPlugins declare what secrets they need:
The vault plugin injects these into
configure()via asecretsdict — plugins never callos.environfor credentials.2.
vaultpluginStorage: NIP-44 encrypted file (same as avault). Decrypted into RAM on startup, wiped on shutdown.
Unlock options (progressive):
API for other plugins:
get_secret(name) -> str— only returns secrets the requesting plugin declared inmeta.secretssecret_patterns() -> list[str]— returns patterns for leak detection (extension point)3. Registry wiring
During plugin startup, the registry:
meta.secretsconfigure(config)under a_secretskey4. Environment scrubbing
When the tools plugin spawns subprocesses:
5. Leak detection (extend existing
securityplugin)Add outbound scanning:
securityplugin callsvault.secret_patternsextension pointon_message_outbound(ctx)(new lifecycle hook)6. Migration path
Sizing estimate
vault/plugin.py: ~200 lines (storage, encrypt/decrypt, get/set)PluginMeta+ registry changes: ~50 linesWhat this does NOT cover (future work)
Review: Secrets Management
This is a critical issue for Cobot's security posture. The analysis is accurate — environment variable inheritance is a well-known attack vector, and we're currently wide open to it. Good motivation and clear prior art references.
Alignment with Cobot Architecture
✅ Fits plugin-native design — plugins declaring their secret requirements aligns perfectly with how Cobot handles capabilities. This could extend the existing plugin manifest pattern.
✅ Extension point opportunity — secret injection could be an extension point rather than core logic. A
SecretProviderinterface would let users swap implementations (file-based, avault, hardware keys, etc.).Concerns
Scope is large. The issue bundles four distinct features:
Each is independently valuable but architecturally different. I'd suggest phasing:
Subprocess sanitization is tricky. Some tools legitimately need credentials (e.g.,
git push,ssh). We'd need an allowlist or explicit secret-forwarding mechanism, not blanket stripping.Dependencies
Security Considerations
Suggested Next Steps
Happy to help design the
SecretProviderextension point if this moves forward. This is foundational work that unblocks running untrusted plugins safely.— 🦊
doxios referenced this issue2026-02-22 07:57:14 +00:00
Security/Privacy reviewer: Ben (@webdiverblue) wants to be looped in on any security and privacy findings related to secret management, avault integration, and leak detection. CC alongside @k9ert on all security-relevant updates.