TypeScript methods return promises unless marked sync. Python and Ruby methods are synchronous. A dash means the language has no such method.
Checking calls#
| TypeScript | Python | Ruby | Does |
|---|---|---|---|
| check(tool, args, { id, messages, approvedByUser }) | check(tool, args, *, id, messages, approved_by_user) | check(tool, args, id:, messages:, approved_by_user:) | Before-guards; returns a verdict. A call that may run is counted toward budgets. |
| after(tool, args, result, { id, messages }) | after(tool, args, result, *, id, messages) | after(tool, args, result, id:, messages:) | After-guards; returns what the model reads (TypeScript: { result, results }) |
| wrap(tool, fn) (sync, returns an async function) | wrap(tool, fn=None, *, messages=None) | wrap(tool) { |args| } | Both around your function |
| preview(tool, args) | - | preview(tool, args) | Dry-run engine check |
| allowedTools(names?) | allowed_tools(names=None) | allowed_tools(names) | Tools within the task's ceiling, plus the human tools |
Adapters#
| TypeScript | Python | Ruby | Does |
|---|---|---|---|
| tools(tools) (sync) | - | - | Wraps AI SDK tools |
| toolApproval (getter) | - | - | For AI SDK toolApproval |
| prepareStep (getter) | - | - | For AI SDK prepareStep |
| budgetExceeded (getter) | - | - | For AI SDK stopWhen |
| - | - | ruby_llm(tool, chat: nil) | Guards a RubyLLM tool |
| humanTools(jsonSchema, { methods }) (sync) | human_tools(methods=None) | human_tools(methods:) | Human tools |
| - | - | ruby_llm_human_tools(methods:) | Human tools as RubyLLM tools |
People in the loop#
| TypeScript | Python | Ruby | Does |
|---|---|---|---|
| startVerification({ verdict, method, permission }) | start_verification(*, verdict, method, permission) | start_verification(verdict:, method:, permission:) | Sends the person a code or push |
| submitCode(code, challengeToken?) | submit_code(code, challenge_token=None) | submit_code(code, challenge_token = nil) | Passes on the person's code |
| verificationStatus(challengeToken?) | verification_status(challenge_token=None) | verification_status(challenge_token = nil) | Polls a verification |
| completeVerification(challengeToken?) | complete_verification(challenge_token=None) | complete_verification(challenge_token = nil) | Records a finished verification |
| verifiedAt() | verified_at (property, epoch seconds) | verified_at | When the person last verified in this run |
| confirm(tool, args) | confirm(tool, args) | confirm(tool, args) | The person confirmed this exact call |
| requestApproval(call) | request_approval(call) | request_approval(call) | Files a reviewer request for a call |
| approvalStatus(id) | approval_status(id) | approval_status(id) | Where a reviewer request stands |
| requestPlan(calls, reason?) | - | request_plan(calls, reason:) | Files a plan |
| planStatus() | - | plan_status | Where the run's plan stands |
Task and session#
| TypeScript | Python | Ruby | Does |
|---|---|---|---|
| token() | token() | token | The task token, starting the task on first use |
| taskId() | task_id() | task_id | The task id |
| whoami() | whoami() | whoami | Who the agent works for and what the task allows; cached |
| session() | session() | session | The run's session id, created on first use |
| complete() | complete() | complete! | Ends the session and completes the task |
| revoke() | revoke() | revoke! | Ends the session and revokes the task |
| property(name) | property(name) | property(name) | Reads a secret |
| sign(name, { claims } or { data }) | sign(name, *, claims, data) | sign(name, claims:, data:) | Signs with a key pair |
| reportTools(definitions) | - | report_tools(definitions) | Reports tool definition hashes |
Grounding, identity and budgets#
| TypeScript | Python | Ruby | Does |
|---|---|---|---|
| ground(...values) (sync) | ground(*values) | ground(*values) | Values known to be true, for grounding |
| identify(...values) (sync) | identify(*values) | identify(*values) | Who is asking, for requesterOnly; also grounds them |
| recordUsage({ usd }) | record_usage(*, usd) | record_usage(usd:) | Adds model spend for budget |
| recentExecutions() | recent_executions() | recent_executions | Executions in the last hour for this agent and person, with tiers |
| budgetExhausted() | budget_exhausted() | budget_exhausted? | A run budget is used up |
| snapshot() | snapshot() | snapshot | A copy of the run's state |
Attributes#
| TypeScript | Python | Ruby | Meaning |
|---|---|---|---|
| id | id | id | The run id |
| harness | harness | harness | The harness |
| options | - | - | The options the run was created with |
| toolNames | tool_names | tool_names | Tools seen through the adapter (TypeScript, Ruby) or wrap (Python) |