AI / User guide
AI agents and runs
Configure reusable AI agents and inspect tool execution, approvals, cancellation, and run history.
On this page
Before you begin
Have an available gateway route and model, plus permission to configure agents and their tools. Supply secrets through supported bindings.
Get started
- Create an agent template and configure its instructions, model route, and tools.
- Review which actions need approval and publish the intended version.
- Start a run with a bounded task and inspect its progress.
- Approve required actions only after reviewing their concrete inputs and intended effects.
Operate the service
Inspect run steps, tool results, and redacted traces for diagnosis. Cancellation is a runtime action; verify that execution reaches a terminal state. Keep reusable templates versioned so run history can be tied to the configuration that executed.
Availability and limits
Agent capability depends on the configured tools and runtime. Do not grant broad tool permissions to compensate for an unrelated provider failure. Approval pauses are part of execution and can require a human to resume work.
Troubleshooting
If a run pauses, check for an outstanding approval. If it fails before tool execution, inspect gateway/model configuration and secret bindings. Check the exact failed step before rerunning actions with external effects.
Next steps
Use the CLI guide to automate repeatable work, or the API guide to integrate Anchras with your own tools.
CLI commands
Install and authenticate using the CLI guide. The table describes command families; required arguments are shown in their usage output.
| Command | Purpose |
|---|---|
ai agents list / get / versions / inspect-version / triggers / create / save-version / promote / rollback / disable / enable / enable-trigger / delete | Agent definition/version lifecycle via AIAgentTemplateService; tool entries use tool|resource_scope|network_policy|approval_mode, and --memory-shards attaches governed memory shards to a version. Triggers use --trigger 'kind\|config_json'; a scheduled/webhook/event trigger config may include a "swarm_id" key to enqueue a swarm run (topology + all members) instead of an agent run when it fires (the trigger payload becomes the swarm input) — the swarm target must exist with all members live at fire time or the fire is skipped and audited. rollback points the live agent back at an earlier saved version. disable flips a live agent to disabled (kill-switch: refuses new runs, terminalizes queued runs when a worker claims them, and stops scheduled/webhook/event triggers); enable returns a disabled agent to live. The kill-switch boundary is claim time: it does not forcibly cancel a run that is already executing; use ai runs cancel --id <run-id> when that run must be stopped. Deleting an agent with terminal run history is destructive and requires both --delete-run-history and --yes; non-terminal runs always block deletion. An agent lives in a project: list shows one (--project) and create takes --project; its versions and runs live in the same project. A trigger fires as its owner (the agent's owner, or whoever re-enabled it last) and only while that owner holds ai_run.create in the project the agent (or the swarm it starts) holds; otherwise the fire starts nothing and disables the trigger with a reason that says whether the agent moved to another project or the owner no longer has ai_run.create there. triggers --id <agent> (or --version-id) lists a version's triggers with their status, owner and disabled reason; ai runs trigger on a disabled trigger answers FAILED_PRECONDITION with the reason. enable-trigger --trigger-id <id> re-enables a disabled trigger: it needs ai_agent.update on the agent and ai_run.create in the current project, and makes you the trigger's owner (audited as ai_agent.trigger_enabled); saving a new version also re-arms its triggers, as the agent's owner. |
ai runs list / start / get / watch / approve / reject / cancel / retry / trigger | Agent run execution, trigger invocation, and approval operations via AIAgentRunService; list supports --agent, --status, --start, and --end. A run lives in its agent's project (project_id in -o json); list shows one project (--project), or with --agent that agent's runs. |
API reference
Browse procedures, request and response types, and download the complete OpenAPI contract.
