Security & Local-First Model
How DevBro protects local access, scans third-party skill repositories, and respects repository boundaries.
DevBro assumes two real-world realities: loopback servers need real auth, and third-party skill files are untrusted input.
Loopback daemon hardening
- Loopback-only binding: By default, the daemon answers only
127.0.0.1,localhost, and[::1]. - 32-byte per-user access token: Stored at
<data-dir>/access-tokenwith user-only permissions (0600). Rotate anytime withcode-buddy token --rotate; active daemons revoke old tokens and sessions within two seconds. - Browser session isolation: Authenticated browsers use an
HttpOnly,SameSite=Strictcookie scoped per port plus an in-page token check so other local ports or external websites cannot call the API. - No silent network mode: Exposing the daemon beyond loopback requires explicit opt-in (
CODE_BUDDY_ALLOW_NETWORK=1), and we recommend an SSH tunnel (ssh -L 4321:127.0.0.1:4321) instead.
Untrusted until reviewed (Skill Scanner)
External git skill repositories (such as community SKILL.md collections) are cloned with hardened git flags — no hooks, no submodules, user git config ignored, never checked out into a working tree — and stay inactive until reviewed.
Every imported or updated skill runs through an offline static pattern scanner plus optional tool-free intent review:
- Flags bundled scripts/executables,
curl | sh,sudo, recursive deletes (rm -rf), and force-pushes. - Flags references to secret paths (
~/.ssh,.env, tokens) and suspicious outbound URLs. - Detects hidden prompt-injection tricks: zero-width unicode characters, HTML comments, and encoded blobs.
- Assigns a risk level (
low,medium,high) with exact line citations. High-risk skills are blocked unless you explicitly override that skill.
Honest security boundaries
A coding assistant executing tasks runs as your OS user. Approval prompts, check consent, and setBy: "user" markers protect against accidental drift and buggy prompts — they are not an OS-level sandbox against a deliberately malicious local binary.