Validate the call
Reject bad types, missing fields, unsafe paths, invalid entities, wrong destinations, and tools outside the registry.
Tool boundary →TOOL VALIDATIONRuntime safety for agents that take real action
Mycelium sits between your agent and its tools. Configure the controls that matter, then validate inputs, scope, authority, context, and execution state before a call can touch the real world.
Framework agnostic · Python 3.10+ · Plain Python · MIT
25KPyPI downloads{order: "ORD-42"}Wrong answers can be corrected.
Mycelium prevents runtime failures at the last responsible moment: after the model proposes a tool call, before the tool can cause damage.
THE SAFETY SPECTRUM
Turn on the controls your workflow needs. They compose around the same tool-call path.
Reject bad types, missing fields, unsafe paths, invalid entities, wrong destinations, and tools outside the registry.
Tool boundary →TOOL VALIDATIONFreeze the tool allowlist, require exact destructive grants, and re-check expiring authority and decide-time facts at the moment of use.
Scope & grants →SCOPE & AUTHORITYCatch stale tool data, malformed message history, orphan results, duplicate IDs, and superseded checkpoints before the next action.
Context guards →CONTEXT INTEGRITYDetect repeated tool patterns, enforce step/token/USD ceilings, and refuse “done” until required work is complete.
Run controls →RUN CONTROLBlock raw credentials before claim, use secret references, and keep writes inside host-approved destination policy.
Data safety →DATA SAFETYClaim consequential actions, prevent concurrent execution, recover ambiguous outcomes, and return stored results when work already completed.
Execution control →EXECUTION CONTROLONE TOOL CALL / FIVE DECISIONS
Mycelium evaluates deterministic facts in order. A refusal is returned to the agent as a useful runtime outcome, not discovered later in a dashboard.
Schema, registry, entity, path, secret, destination.
Frozen scope, object grant, authority window, current facts.
Fresh context, loop progress, budget, completion state.
Durable claim, effect identity, lease, prior outcome.
Only now does the call cross the side-effect boundary.
No tool body. No damage. A named reason returns to the runtime.
WHERE CONSEQUENCES LIVE
Payments
Customer
messages
Infrastructure
Business
records
Files &
secrets
Subagents &
handoffs
AGENT-ASSISTED SETUP
The repository ships a $mycelium-setup skill. It inventories your tools, classifies their effects, fills the YAML, wires the runtime, and runs Doctor and Verify. You still approve consequential classifications, identity, secrets, and provider access.
# in your coding agent
$ Use $mycelium-setup to protect this project.
DISCOVER tools + framework
CLASSIFY side effects
WIRE config + runtime
VERIFY doctor + failure scenariosPROVE THE PROTECTION
Doctor checks whether safety is configured and detectably wired. Verify exercises synthetic runtime failures. Provider Verify challenges reconciliation adapters with lag, ambiguity, duplicates, malformed handles, and forbidden writes.
$ mycelium doctor --config mycelium.yaml
# representative checks
PASS tool registry
PASS side-effect classification
PASS durable storage
PASS scope + policy wiring
$ mycelium verify --scenario simulation
PASS protection held under failureEARLY FIELD EVIDENCE
This is evidence for one live execution lane, not the whole safety catalog. The lane exercised normal success paths; no genuine UNKNOWN outcome occurred, so live recovery remains untested. Audit the field notes ↗
THE HONEST BOUNDARY
Mycelium ships deterministic guards for
execution, validation, loops, context integrity, completion, scope, secrets, destinations, destructive authorization, authority timing, and use-time facts.
It does not yet claim deterministic prevention for
hallucination, open-ended goal misalignment, or prompt injection. Those remain judgment or roadmap territory.
START WITH THE RISKIEST TOOL