01 · Prevent
Refuse the action
before it lands.
Mycelium validates the call, checks scope and authority, controls execution state, and either runs, waits, returns a stored outcome, or stops safely. Invalid, unauthorized, runaway, and repeated actions stop at the boundary.
What this stops
The expensive mistake,
not the wrong answer.
- Reject invalid arguments and unapproved destinations.
- Refuse destructive calls outside the approved scope.
- Prevent duplicate charges, emails, or writes after a timeout.
- Stop runaway loops, budget overruns, and premature “done.”
Failure catalog
Named boundaries.
Not a count.
Each class maps to a runtime surface. Configure only what the workflow needs.
VALIDATIONTool misuseValidate inputs, outputs, entities, paths, and allowlists.@bounded
SCOPECascading permissionFreeze the run allowlist and reject widening mid-flight.Scope guard
SECRETSSecret-in-argsBlock raw credentials before claim. Pass secret:// references.secret_args
EXECUTIONUnknown or repeated effectsProve run-or-not and enforce at-most-once when retries or crashes occur.Action ledger
LOOPSInfinite reasoning loopsRecognize repeated action patterns with no progress.Loop guard
CONTEXTContext corruptionKeep messages, history, and session state from going stale.Context
COMPLETIONPremature terminationRequire declared outcomes before a run can finish.Completion
Shared boundary
Validate, authorize, then execute.
Applicable controls compose around one tool-call path. This example shows execution identity: the next dispatch resolves the existing transition instead of charging again.
Python applications use this boundary directly. TypeScript, Go, and other runtimes use the same authoritative engine through a self-hosted HTTP/JSON sidecar.
send_payment.py
from mycelium import load_config
config = load_config("mycelium.yaml")
@config.apply
def send_payment(amount: float, recipient: str) -> dict:
return gateway.charge(amount, recipient)
send_payment(amount=100.0, recipient="acct_123", tool_call_id="call_pay")
Next