Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ the MCP core behind it (up to 0.20 also the ChatGPT Site it published). It follo
[Keep a Changelog](https://keepachangelog.com). Each `## [X.Y.Z]` section becomes the notes of the
GitHub release vX.Y.Z.

## [Unreleased]

### Security

- `answer_approval` answers only the request the user heard. It takes the request's id
(`read_approval` gives it) and answers nothing for a request that is no longer waiting, instead of
the first waiting request, a number in the current list or a request matched by words: the list
changes while the user listens (answered in Paseo, withdrawn, replaced), so an "allow it" could
reach a request nobody read out. Without an id, or with a stale one, the answer is `needs_request`
or `request_changed` with the requests waiting now.
- Allowing takes a confirmation bound to the request's whole content (HMAC over the chat, the request's
id, its kind, the tool's name, title and description, its detail and input, and the buttons allow
presses; two minutes). `read_approval` gives
each request `answer_approval` takes with `content`, all it runs (the tool, the command with its directory
and flags, a file's content or diff, the whole plan, a tool's arguments), and its confirmation;
without a valid one `answer_approval` answers `needs_confirmation` with that content. A long command
or a file's content can no longer be allowed after only a summary was read out, and content changed
under the same id allows nothing. Content too long to read out (over 6000 characters) is allowed in
Paseo (`too_long`).

## [1.2.0] - 2026-11-30

Claude and ChatGPT connect with one **Allow** instead of a code, as many accounts of each as you like,
Expand Down
13 changes: 11 additions & 2 deletions docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,18 @@ The tools that change something: `start_chat`, `send_message`, `answer_approval`
valid answer; it never fills one in, and `answer_approval` will not allow a question request (Codex
would answer it with the first options). A question that asks for a secret is left to Paseo. These
are server checks.
- **Approvals reach the request the user heard, as they heard it.** `answer_approval` answers only a
pending request named by its id, and allow only with a confirmation bound to that request's whole
content (HMAC over the chat, the request's id, its kind, the tool's name, title and description,
its detail and input, and the buttons allow presses; two minutes). `read_approval` and the
`needs_confirmation` answer give that content whole, every field, so a long command, a file's
content or a tool's arguments are never allowed after only a summary was read out; content too long
to read out is allowed in Paseo instead. A request that was answered elsewhere, withdrawn or
replaced, or whose content changed under the same id, is not answered. These are server checks.
- **Read-back for risky agent actions.** Approving a request, stopping or archiving a chat need the
user to have heard exactly what will happen and said yes. This is a rule the assistant follows, not a
server check.
user to have heard exactly what will happen and said yes. That the user said yes is a rule the
assistant follows, not a server check; for approvals the server checks what was put to the user, as
above.
- **The assistant's own approvals.** Claude and ChatGPT may also ask before a tool runs, depending on
how you set the connection's permissions there. God Mode does not depend on it.

Expand Down
18 changes: 16 additions & 2 deletions docs/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Kind is taken from the tool's annotations. `*` marks a required argument.
| `list_models` | read | `provider` | The agent runtimes Paseo can start (Claude, Codex…), each with its models, their thinking levels and its permission modes, from Paseo's own catalog. |
| `start_chat` | write | `prompt`*, `project`, `workspace`, `provider`, `model`, `thinking`, `mode` | Start one new chat with the task as its first message, like New chat, in a project (with a workspace of its own) or as another tab of a workspace that exists, on the runtime and model asked for, checked against Paseo's catalog first. A project or a workspace is given. |
| `send_message` | write | `chat`*, `text`*, `if_busy` (steer, interrupt), `if_archived` (restore) | Send one message to an existing chat. |
| `read_approval` | read | `chat`* | Everything a chat waits on, in full: a request that asks questions comes with every question and its numbered options, the recommended one marked. A plan, or a command longer than its line, comes whole (`text`), up to 6000 characters. |
| `answer_approval` | write | `chat`*, `decision`* (allow, deny), `request` | Allow or deny what a chat is waiting for; a request that asks questions takes `answer_questions`. |
| `read_approval` | read | `chat`* | Everything a chat waits on, in full: a request that asks questions comes with every question and its numbered options, the recommended one marked. A request `answer_approval` takes comes whole, every field, with the confirmation that allows exactly it; a plan or command too long for that is read in pages (`text`) and allowed in Paseo. |
| `answer_approval` | write | `chat`*, `decision`* (allow, deny), `request` (id), `confirmation` | Allow or deny the request the user heard, named by its id; allow takes that request's confirmation. A request that asks questions takes `answer_questions`. |
| `answer_questions` | write | `chat`*, `request`*, `answers`* (`question`, `options`, `text`) | Send the user's answers to the questions a chat asks (Claude's AskUserQuestion, Codex's questions), the way Paseo's question form does. |
| `stop_chat` | write, destructive | `chat`* | Stop what a chat is doing now. |
| `archive_chat` | write, destructive | `chat`* | Archive a chat that is not working; a new message brings it back. |
Expand Down Expand Up @@ -119,6 +119,20 @@ Kind is taken from the tool's annotations. `*` marks a required argument.
name and an unknown `workspace_id` change nothing either. No read-back: one more call undoes it.
Which chat is open on a screen is not known to God Mode (Paseo keeps it for its notifications and
gives it to no client), so "the chat I have open" needs its name.
- **Approvals.** `answer_approval` answers only the request named by its id (`read_approval` gives
it), never one picked by position or by words: what a chat waits on changes while the user listens
(answered in Paseo, withdrawn, replaced). Without an id, or with one that no longer waits, nothing
is answered and the answer is `needs_request` or `request_changed` with the requests waiting now.
Allowing runs all of a request, so `read_approval` gives each request `answer_approval` takes with
`content`: the tool with its title and description, its detail and input, every field Paseo gives,
and the button allowing presses (the command with its directory and flags, a file's new content or
diff, the whole plan, a tool's arguments), not just the one-line `what`. Allow takes a
confirmation: an HMAC token, keyed from the plugin's own secret, over the chat, the request's id and its
kind, that content and the buttons allow presses, valid for two minutes. Without a valid one the
answer is `needs_confirmation` with the content and a new confirmation, and nothing is allowed; a
confirmation for other content (changed under the same id), another request or another chat, or an
expired one, allows nothing either. A request whose content is too long to read out whole (over
6000 characters) is allowed in Paseo, not here (`too_long`); it can still be denied by its id.
- **Questions an agent asks.** Claude's AskUserQuestion and Codex's questions (request_user_input,
and its asynchronous ones) wait in Paseo as a request of kind `question`, and such a chat reads as
"waiting for an answer". `read_approval` gives the request's id and every question: its number and
Expand Down
4 changes: 2 additions & 2 deletions eval/cases.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,15 @@ const core = [
lang: "ru",
context: OVERVIEW,
phrase: "дай добро",
expect: { first: ["answer_approval"], args: { chat: FLEET, decision: "allow" }, writes: 1, maxCalls: 1, state: "delivered" },
expect: { first: ["read_approval", "answer_approval"], target: "answer_approval", args: { chat: FLEET, decision: "allow" }, writes: 1, maxCalls: 3, state: "delivered" },
},
{
id: "core.ctx.deny",
group: "elliptic",
lang: "ru",
context: OVERVIEW,
phrase: "откажи",
expect: { first: ["answer_approval"], args: { chat: FLEET, decision: "deny" }, writes: 1, maxCalls: 1, state: "delivered" },
expect: { first: ["read_approval", "answer_approval"], target: "answer_approval", args: { chat: FLEET, decision: "deny" }, writes: 1, maxCalls: 3, state: "delivered" },
},
{
id: "core.ctx.read-release",
Expand Down
54 changes: 44 additions & 10 deletions eval/ops.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -698,26 +698,54 @@ export function createOps({ world, scenario = {}, text, slash = null, models = n
return { text: `Sent to ${truncate(target.title, 70)}; it arrived.\n${result.text}`, data: { chat_id: target.id, short_id: target.id.slice(0, 7), project: target.project, ...result.data } };
}

async function answerApproval(_url, { chat, decision, request } = {}) {
// In versions that bind approvals, answer_approval answers only the request named by its id, and allow takes that
// request's confirmation (read_approval gives both); earlier versions take the first request.
const boundApprovals = typeof questions?.approvalContent === "function";
const evalConfirmation = (target, permission) => `eval.${target.id}.${permission.id}`;

async function answerApproval(_url, { chat, decision, request, confirmation } = {}) {
const outcome = takeOutcome("answer_approval");
log("answerApproval", { chat, decision, request }, outcome);
log("answerApproval", { chat, decision, request, confirmation }, outcome);
const picked = pickChat(chat);
if (picked.ask) return picked.ask;
const target = picked.chat;
// Since 0.15.0 a question request takes answers, not allow.
if (questions && target.permissions[0]?.kind === "question" && decision === "allow") return questions.questionsNeedAnswers(target, target.permissions[0], now);
if (target.permissions.length === 0) {
const named = boundApprovals && typeof request === "string" && request.trim() !== "";
return {
text: `${chatLine(target, now)}\nNothing is waiting for approval here, so nothing was allowed or denied. If the agent asked the user a question in its text, answer it with send_message.`,
data: { chat_id: target.id, done: false, what: null },
data: { chat_id: target.id, done: false, what: null, ...(named ? { outcome: "request_changed", requests: [] } : {}) },
};
}
let permission = target.permissions[0];
const behavior = decision === "allow" ? "allow" : "deny";
if (boundApprovals) {
const id = typeof request === "string" ? request.trim() : "";
permission = target.permissions.find((p) => p.id === id);
if (!permission) {
const requests = target.permissions.map((p, i) => {
const data = questions.requestData(p, i + 1);
return data.answer_with === "answer_approval" ? { ...data, confirmation: evalConfirmation(target, p) } : data;
});
return {
text: [`${chatLine(target, now)}\nNothing was ${behavior === "allow" ? "allowed" : "denied"}: ${id ? `${truncate(target.title, 70)} no longer waits on that request; it was answered, withdrawn or replaced.` : "answer_approval answers only the request the user heard, named by its id."}`, `The user has not answered what it waits on now. Tell them, each request with all it runs, and answer one only when they answer that one: then call answer_approval again with its id${behavior === "allow" ? " and confirmation" : ""} from requests.`, ...requests.map((r) => (r.answer_with === "answer_questions" ? `- ${r.what} (it asks questions: answer_questions)` : r.answer_with === "paseo" ? `- ${r.what} (${r.why ?? "the user answers it in Paseo"})` : `- ${r.what}. All it runs:\n${r.content}`))].join("\n"),
data: { chat_id: target.id, done: false, outcome: id ? "request_changed" : "needs_request", decision: behavior, what: null, requests },
};
}
}
// Since 0.15.0 a question request takes answers, not allow.
if (questions && permission.kind === "question" && behavior === "allow") return questions.questionsNeedAnswers(target, permission, now);
if (boundApprovals && behavior === "allow" && confirmation !== evalConfirmation(target, permission)) {
const content = questions.approvalContent(permission);
return {
text: `Nothing was allowed yet: ${describePermission(permission)}. Tell the user all it runs; only after their yes, call answer_approval again with this request's id and confirmation. All it runs:\n${content}`,
data: { chat_id: target.id, done: false, outcome: "needs_confirmation", kind: permission.kind, decision: behavior, request: permission.id, what: describePermission(permission), content, confirmation: evalConfirmation(target, permission) },
};
}
fail(outcome);
const what = describePermission(target.permissions[0]);
target.permissions = [];
const what = describePermission(permission);
target.permissions = target.permissions.filter((p) => p !== permission);
target.attention = null;
target.status = decision === "allow" ? "running" : "idle";
const behavior = decision === "allow" ? "allow" : "deny";
target.status = behavior === "allow" ? "running" : "idle";
return { text: `${behavior === "allow" ? "Allowed" : "Denied"}: ${what} in ${truncate(target.title, 70)}.`, data: { chat_id: target.id, done: true, decision: behavior, what } };
}

Expand All @@ -726,7 +754,13 @@ export function createOps({ world, scenario = {}, text, slash = null, models = n
log("readApproval", { chat });
const picked = pickChat(chat, { read: true });
if (picked.ask) return picked.ask;
return withNote(questions.approvalResult(picked.chat, now), picked.note);
let result = questions.approvalResult(picked.chat, now);
if (boundApprovals) {
// As the server does: the requests carry their confirmations, and the text shows them in brackets.
const requests = result.data.requests.map((r, i) => (r.answer_with === "answer_approval" ? { ...r, confirmation: evalConfirmation(picked.chat, picked.chat.permissions[i]) } : r));
result = questions.approvalResult(picked.chat, now, requests);
}
return withNote(result, picked.note);
}

async function answerQuestions(_url, { chat, request, answers, waitSeconds } = {}) {
Expand Down
Loading