Invoke doesn’t replace your agent framework. It controls what happens when the agent reaches for a real tool. Keep your LangChain chains, Claude Code tools, OpenAI functions, MCP servers and custom scripts as they are.
The execution loop
1
The agent names an action
It names the tool, the arguments, who is acting, and an idempotency key that names the action.
2
Invoke admits it, or refuses it
In order, before anything runs:
- Identity. Is the key allowed to act as this agent? An agent key can only ever be its own agent.
- Duplicates. Has this exact action already run? If so, it doesn’t run again: the call gets the original receipt.
- Permission. Is this tool on the agent’s allowlist?
- Policy. Do your workspace policies allow it, block it, or require a human?
- Claims. Is the work item, such as an issue, claimed by another agent?
- Budget. Can the workspace and the agent afford it? The cost is reserved now, before the action runs.
3
The action runs once
Invoke runs the tool, then settles the reserved cost and seals a receipt. If the answer is lost on the way back, the action is marked unknown rather than failed. A tool that is safe to re-run is reconciled by sending the same action again. Anything else is held until someone checks the real system and settles it, because a blind retry could act twice.
4
Your agent gets an answer
call() resolves only when the action happened. Otherwise it throws, and the error’s class says whether it happened:The receipt
Every committed action gets a receipt, signed when it commits, recording who acted, why, the input, the output, the cost, and any approval:verified means the ledger still matches what was signed. replay_count counts the repeats that were answered with this receipt instead of running again.