Ask an AI agent on a machine
An agent connected to CMDOP, or your own program through the SDK, can put a question to an AI agent program installed on one of your machines (Claude Code, Codex) and get its answer back. It works the same way for every program, so ChatGPT can ask Claude Code, and Claude can ask Codex, with no integration between the vendors.
Before you start
- The agent program is installed and signed in on that machine, under the same user that runs CMDOP. Its model runs at its vendor, and each answer counts against that vendor account.
- Nothing to switch on: every machine allows it unless its owner turned
agentoff inceiling.json, whoseagentskey can also name which programs may be asked (allow), the one asked when none is named (default), and how far they may go (tier). - The agent or program that asks may run commands (
execin its grant), or holdsagentalone. Listing needs onlyread.
Steps
-
See who can answer. Call
agent_liston the machine. Each row has the agent’sid, itstier, whether it canresumea conversation and whether it isbusy, anddefaultnames the one a prompt goes to withoutagent. With no allowed agent installed, the machine offers none of these tools. -
Ask. Call
agent_promptwithprompt(up to 16 KiB) and, if you want a particular one,agent. It waits up towait_secs(default 50, at most 240) and returnsstateandtext:{"task": "…", "agent": "claude-code", "state": "done", "session": "…", "text": "The weakest point is …", "tier": "read_only"}A longer answer comes back as
state: "running". Read the rest withtask_output{task}. -
Continue. Pass the answer’s
sessionback toagent_promptwith the next question. The agent remembers the conversation.agent_sessionslists recent sessions, newest first. -
Stop a run with
agent_cancel{task}.
From the SDK, the same calls are box.agent.list(), box.agent.prompt({ prompt, session }),
box.agent.sessions() and box.agent.cancel({ task }) (SDK). Streaming callers also receive the
agent’s progress as it works.
How far the asked agent may go
| Tier | It may |
|---|---|
text_only | answer in words. Any attempt to use a tool stops the run with tool_refused |
read_only | also read files in its folder. It changes nothing and runs no commands. This is the default |
There is no tier that changes files or runs commands. A call may ask for a lower tier than the machine allows,
never a higher one. Claude Code offers both tiers; Codex answers in words only (text_only).
cwd picks the folder the agent reads. Without it, the agent works in a folder of its own that stays the same, so
a session continues where it left off. Folders that hold keys or credentials (your home folder itself, ~/.ssh,
the agents’ own folders, a repository’s .git) are refused.
Safety
- The prompt and the answer are not stored by CMDOP. The record shows that the agent was asked, by whom and how it ended (the record of calls).
- Send no secrets in the prompt: it goes to the other program’s vendor.
- If the asked agent refuses, bring that back to the person; do not rephrase the request until it agrees.
- One question at a time per agent on a machine: a second one answers
busy.
If it fails
| Code | What to do |
|---|---|
denied | the grant or the machine’s ceiling lacks agent, the agent is not in allow, or cwd is refused |
not_found | the agent is not installed there, or the cwd folder does not exist |
busy | wait for the running answer, or stop it with agent_cancel |
tool_refused | the agent tried to use a tool on a text_only run; ask in a way it can answer in words, or allow read_only |
sandbox_unavailable | the machine cannot run the agent safely, so nothing started |
unknown_tool | the machine offers no agent tools: no allowed agent installed, or an older cmdop |
Related
Ask another AI for a second opinion · Grant risk classes ·
ceiling.json · Tools