symbi-claude-code
CLAUDE.md4 starsChanged 9 months agoApache-2.0View on GitHub
This project is a Claude Code plugin that delivers default-on protection against secret reads, sensitive writes, and destructive shell commands. The runtime upgrade path (Cedar evaluation, MCP tools, governed agents) is opt-in and only activates when the symbi binary is installed. The plugin's default behavior is Tier 2 protection. No local-policy.toml required. The built-in deny defaults block: - Reads: .env, .env.* (except .env.example/.sample/.test), .ssh/, .aws/, .gcp/, gcloud/, .npmrc, .pypirc, .netrc, *.pem, *.key, id_rsa/id_ed25519/id_ecdsa, secrets/, credentials/, config/database.yml, config/credentials.json, config/master.key. - Writes:…
- Pipes a download into a shell
- Reads credentials
- Deletes or force-pushes
- Commits and pushes
In this repository7 other files it gives its agents.
- symbi-agent-sdkSkill
- symbi-auditSkill
- symbi-dslSkill
- symbi-initSkill
- symbi-pinSkill
- symbi-policySkill
- symbi-verifySkill
The file
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Writes: all of the above plus .github/workflows/.
- Very specific: line 54
All hooks check the .symbiont/disabled marker first and the SYMBIONT_MANAGED env var second.
- Very specific: line 95
When the symbi binary is installed, additional features light up automatically — no plugin changes required:
- Very specific: line 108
When Symbiont's CliExecutor spawns Claude Code as a governed subprocess, it sets SYMBIONT_MANAGED=true.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Symbiont Plugin Context
This project is a Claude Code plugin that delivers default-on protection
against secret reads, sensitive writes, and destructive shell commands.
The runtime upgrade path (Cedar evaluation, MCP tools, governed agents)
is opt-in and only activates when the symbi binary is installed.
Default Posture (Tier 2)
The plugin's default behavior is Tier 2 protection. No local-policy.toml
required. The built-in deny defaults block:
- Reads:
.env,.env.*(except.env.example/.sample/.test),.ssh/,.aws/,.gcp/,gcloud/,.npmrc,.pypirc,.netrc,*.pem,*.key,id_rsa/id_ed25519/id_ecdsa,secrets/,credentials/,config/database.yml,config/credentials.json,config/master.key. - Writes: all of the above plus
.github/workflows/. - Bash:
rm -rf /,rm -rf /*,rm -rf ~,git push --force/-f,curl ... | sh|bash,wget ... | sh|bash,chmod 777,mkfs*,dd if=, fork bombs. sudois warned (block in[mode]=strict).
.symbiont/local-policy.toml extends these defaults with project-specific
rules; it never replaces them unless [mode]=permissive is set.
Modes
[mode] in .symbiont/local-policy.toml:
balanced(default) — built-ins active, sudo warnsstrict— built-ins active, sudo hard-blockedpermissive— built-ins disabled, only the local TOML enforces
Kill switch
.symbiont/disabled makes every hook no-op (still exits 0). Use
/symbi-disable to drop it, /symbi-enable to remove it.
Hooks (always loaded)
scripts/install-check.sh— SessionStart. Detects JSON backend (jq → python3 → bash), nudges on sensitive files when nolocal-policy.tomlexists, runs SchemaPin verification whensymbiis on PATH.scripts/policy-guard.sh— PreToolUse. Hard-blocks deny matches (plain-text reason on stderr + exit 2;sudowarns via stdoutsystemMessage).scripts/policy-log.sh— PreToolUse. Silent advisory slot (recording is handled byaudit-log.sh; retained for future signals).scripts/audit-log.sh— PostToolUse. Appends JSONL to.symbiont/audit/tool-usage.jsonl. Always logs (nosymbiont.tomlgate).
All hooks check the .symbiont/disabled marker first and the
SYMBIONT_MANAGED env var second.
JSON parsing in hooks
scripts/lib/json-extract.sh exposes json_field <payload> <dotted.path>.
Backend selection on first use:
jqif presentpython3(orpython) if present- Pure-bash awk extractor — narrow, refuses payloads with
\uescapes
The bash fallback only handles the field shapes Claude Code emits
(tool_name, tool_input.file_path, tool_input.path,
tool_input.command). Refusing exotic payloads is fail-safe: an empty
return means "no match" so the policy guard does not block what it cannot
parse, and never blocks based on misinterpreted bytes.
Slash commands
Plugin-only (no runtime needed):
/symbi-protect— print active defaults, drop a starter policy file/symbi-disable//symbi-enable— kill-switch toggle/symbi-status— health check/symbi-audit— query the audit log
Runtime-required (need symbi binary):
/symbi-init— scaffold a runtime-managed project/symbi-policy,/symbi-verify,/symbi-pin,/symbi-dsl,/symbi-agent-sdk
Tests
tests/run-tests.sh covers built-in deny patterns, JSON backend parity,
chain-bypass resistance, allowlist exemptions, mode switching, and the
kill-switch marker. Run before committing changes to hooks.
Runtime upgrade path (opt-in)
When the symbi binary is installed, additional features light up
automatically — no plugin changes required:
- Tier 3 (Cedar evaluation):
policy-guard.shrunssymbi policy evaluate --stdin --policies ./policies/after the built-in checks pass. - MCP tools: the plugin connects to a
symbi mcpserver exposinginvoke_agent,list_agents,parse_dsl,get_agent_dsl,get_agents_md,verify_schema. - SchemaPin:
install-check.shverifies pinned MCP servers on session start.
Mode B (ORGA-managed)
When Symbiont's CliExecutor spawns Claude Code as a governed subprocess,
it sets SYMBIONT_MANAGED=true. All hooks early-return so the outer ORGA
Gate is the single source of truth for hard enforcement.
Override .mcp.json at the project or user level to point at the parent
runtime:
{
"mcpServers": {
"symbi": { "type": "http", "url": "${SYMBIONT_MCP_URL}" }
}
}Mode B environment variables:
SYMBIONT_MANAGED=trueSYMBIONT_MCP_URLSYMBIONT_RUNTIME_SOCKETSYMBIONT_SESSION_IDSYMBIONT_BUDGET_TOKENSSYMBIONT_BUDGET_TIMEOUT
File conventions
| Path | Purpose |
.symbiont/local-policy.toml | Project deny/allow rules + mode |
.symbiont/disabled | Kill-switch marker |
.symbiont/audit/ | Local audit log |
agents/*.dsl | (runtime) Agent DSL definitions |
policies/*.cedar | (runtime) Cedar policies |
symbiont.toml | (runtime) Runtime configuration |
AGENTS.md | (runtime) Agent manifest |
On Session Start
scripts/install-check.sh detects the JSON backend and prints a one-line
nudge if sensitive files exist with no local-policy.toml yet. It does
not require any user action and never blocks.
Implementation Plan
See ROADMAP.md for the full implementation history and phase details.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

