Skip to content

docs(tool-gate): document the onToolCall gate + classifier, add example#383

Merged
JackChen-me merged 1 commit into
mainfrom
feat/onToolCall-docs
Jul 16, 2026
Merged

docs(tool-gate): document the onToolCall gate + classifier, add example#383
JackChen-me merged 1 commit into
mainfrom
feat/onToolCall-docs

Conversation

@JackChen-me

Copy link
Copy Markdown
Member

Implements #380 (the third split of #96). Documents the per-call onToolCall
gate (shipped in #377) and the classifyBashCommand classifier (#379), and adds
a runnable example.

Stacked on #382 (#379's classifier). The example imports
@open-multi-agent/core/classifiers, so this branches off
feat/bash-risk-classifier and targets that branch for a clean diff. Once #382
lands on main, retarget this PR's base to main.

What

  • docs/tool-configuration.md gains a "Per-call gating with onToolCall"
    section: where the gate sits (after schema validation, before execute, one
    layer below the name-based grant), the ToolCallContext / ToolCallDecision
    shapes, that deny returns a structured error ToolResult rather than
    throwing, agent-overrides-orchestrator precedence, that it is orthogonal to the
    task-level onApproval, the gated / gateAction / gateReason trace fields
    (with gateReason redacted), and that it is not a security boundary. A "Shell
    risk classifier" subsection documents classifyBashCommand.
  • examples/patterns/risk-gated-bash.ts: a security-audit agent granted bash
    whose onToolCall gate classifies each command and routes safe to allow,
    review to human approval, high to deny.
  • AGENTS.md: cross-links from the tool-layer notes and the /classifiers
    subpath in the exports map.

Scope

Docs and example only. No code or behavior change.

Validation

npm run lint is green; the example typechecks against the /classifiers
subpath and the doc's example link resolves.

Closes #380

@JackChen-me
JackChen-me deleted the branch main July 16, 2026 08:16
…example

Third split of #96 (follow-up to #379). The onToolCall gate shipped in #377 and
the classifyBashCommand classifier in #379; this documents both and adds a
runnable example.

- docs/tool-configuration.md: a "Per-call gating with onToolCall" section (where
  it sits, ToolCallContext/ToolCallDecision, deny returns an error ToolResult not
  a throw, agent overrides orchestrator default, orthogonal to onApproval,
  gated/gateAction/gateReason on the trace with gateReason redacted, not a
  security boundary) plus a shell risk classifier subsection.
- examples/patterns/risk-gated-bash.ts: a security-audit agent that classifies
  each bash command and routes safe/review/high to allow/human-approval/deny.
- AGENTS.md: cross-links in the tool-layer notes + /classifiers in the exports map.

Closes #380
@JackChen-me JackChen-me reopened this Jul 16, 2026
@JackChen-me
JackChen-me changed the base branch from feat/bash-risk-classifier to main July 16, 2026 08:41
@JackChen-me
JackChen-me force-pushed the feat/onToolCall-docs branch from bd46149 to 9905eed Compare July 16, 2026 08:42
@JackChen-me
JackChen-me merged commit 1747afa into main Jul 16, 2026
7 checks passed
@JackChen-me
JackChen-me deleted the feat/onToolCall-docs branch July 16, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs and example for the per-call onToolCall gate

1 participant