Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

permission

The agent’s permission requests (session/request_permission), which brnr holds as approvals until they are answered: by these commands, a bridge, the editor, the response timeout, or the agent giving them up.

brnr permission requests

Lists the approvals waiting, in every process that answers, or in one session.

brnr permission requests [<session>] [--json]

A process that doesn’t answer is passed over, as process list and session list pass over it (they show it unreachable), and said on stderr, brnr: process <pid> is not answering; its approvals aren't listed, in text and --json alike. The exit status stays 0.

Output (--json): each row is permission show’s object, with fewer fields.

FieldTypeMeaning
requestslist of objectsOne for each approval waiting.
requests[].sessionstringIts session.
requests[].requeststringIts handle, p1.
requests[].ownerstringeditor or headless.
requests[].kindstring or nullThe tool call’s kind, as the agent gave it (ACP’s toolCall.kind); null if it gave none.
requests[].titlestring or nullThe tool call’s title, as the agent gave it; null if it gave none.
requests[].optionslist of objects, ACP’sThe agent’s options, as ACP has them: {optionId, name, kind}.
{
  "requests": [
    {
      "session": "sess-1",
      "request": "p1",
      "owner": "headless",
      "kind": "edit",
      "title": "Edit src/lib.rs",
      "options": [
        {
          "optionId": "allow",
          "name": "Allow",
          "kind": "allow_once"
        },
        {
          "optionId": "reject",
          "name": "Reject",
          "kind": "reject_once"
        }
      ]
    }
  ]
}

Text output: a table of the approvals; nothing waiting when there are none.

Exit codes: 0; 1 if it fails. Errors: with <session>, those of a running session.

brnr permission show

Shows one approval waiting, in full, so that it can be judged before it is answered: the tool, its kind and paths, the command or input, the diff of an edit, and the options.

brnr permission show <session> <request> [--json]

Output (--json):

FieldTypeMeaning
requeststringIts handle, p1.
sessionstringIts session.
ownerstringeditor or headless.
answerablebooleanWhether permission allow and reject would be taken: an editor’s session needs the experimental permission in its profile.
why_notstring or nullWhy not; null when it is answerable.
titlestring or nullThe tool call’s title, as the agent gave it.
kindstring or nullThe tool call’s kind, as the agent gave it.
tool_callobject, ACP’sThe agent’s tool call, whole, as ACP has it (toolCall).
optionslist of objects, ACP’sThe agent’s options, {optionId, name, kind}.
timeout_leftnumber or nullSeconds until the response timeout answers it; null without one.
{
  "request": "p1",
  "session": "sess-1",
  "owner": "headless",
  "answerable": true,
  "why_not": null,
  "title": "Edit src/lib.rs",
  "kind": "edit",
  "tool_call": {
    "toolCallId": "perm-1",
    "title": "Edit src/lib.rs",
    "kind": "edit",
    "locations": [
      {
        "path": "src/lib.rs",
        "line": 2
      }
    ],
    "rawInput": {
      "file_path": "src/lib.rs"
    },
    "content": [
      {
        "type": "diff",
        "path": "src/lib.rs",
        "oldText": "one\nold line\nthree\n",
        "newText": "one\nnew line\nthree\n"
      }
    ]
  },
  "options": [
    {
      "optionId": "allow",
      "name": "Allow",
      "kind": "allow_once"
    },
    {
      "optionId": "reject",
      "name": "Reject",
      "kind": "reject_once"
    }
  ],
  "timeout_left": null
}

Text output: the tool call, its options, and how to answer it.

Exit codes: 0; 1 if it fails. Errors: those of a running session, request_not_found.

brnr permission allow, brnr permission reject

Answers an approval. allow answers with the agent’s option of kind allow_once (allow_always with --always), reject with its option of kind reject_once (reject_always with --always).

brnr permission allow <session> <request> [--always] [--option-id <id>] [--json]
brnr permission reject <session> <request> [--always] [--option-id <id>] [--json]
FlagMeaning
--alwaysThe always kind, in place of the once kind.
--option-id <id>Answer with the agent’s option of this optionId instead. Where its kind is one of ACP’s, it must be of the verb’s side, and of the always kind with --always.
--jsonPrint the answer as JSON.

A kind missing or there twice, or an option of the other side, fails and lists the options; nothing is answered (answer_invalid).

Output (--json):

FieldTypeMeaning
sessionstringThe session.
requeststringThe handle.
outcomeobject, ACP’sThe answer sent to the agent, ACP’s outcome: {"outcome": "selected", "optionId": …}.
{
  "session": "sess-1",
  "request": "p1",
  "outcome": {
    "outcome": "selected",
    "optionId": "allow"
  }
}

Text output: p1 allow, the request and the option chosen.

Exit codes: 0; 1 if it fails. Errors: those of a running session, request_not_found, answer_invalid, experimental_disabled, process_stopping.