01 · Prevent
Refuse the action
before it lands.
Mycelium claims the transition, validates the tool, and either executes once or returns the stored result. Duplicate charges, emails, and writes stop at the boundary.
What this stops
The expensive mistake,
not the wrong answer.
- Prevent charging an order twice after a timeout.
- Stop duplicate emails or tickets during redispatch.
- Refuse destructive calls outside the approved scope.
- Stop runaway loops and premature “done.”
Failure catalog
Named boundaries.
Not a count.
Each class maps to a runtime surface. Configure only what the workflow needs.
EXECUTIONUnknown or repeated effectsProve run-or-not and enforce at-most-once before the tool runs.Action ledger
LOOPSInfinite reasoning loopsRecognize repeated action patterns with no progress.Loop guard
VALIDATIONTool misuseValidate inputs, outputs, entities, paths, and allowlists.@bounded
CONTEXTContext corruptionKeep messages, history, and session state from going stale.Context
COMPLETIONPremature terminationRequire declared outcomes before a run can finish.Completion
SCOPECascading permissionFreeze the run allowlist and reject widening mid-flight.Scope guard
SECRETSSecret-in-argsBlock raw credentials before claim. Pass secret:// references.secret_args
Core path
Claim, then execute.
A ledgered tool gets a side-effect class and a transition key. The next dispatch resolves the existing transition instead of charging again.
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