# AI Agent Guardrails: A Graded Tool List With Limits

Guardrails for a security agent are four limits set per tool: scope, permission, approval and stop condition. The worked list below grades nine tools for an agent answering CVE-2026-111497 (Node.js and Brotli, disclosed 21 Oct 2026). Two tools are withheld from the agent, and every write waits behind a person-approved fact sheet.

## Four limits, each from published text

OWASP traces excessive agency to excessive functionality, permissions and autonomy. The four limits below answer them, with the wording of the source. Read 19 Nov 2026.

Quotations from OWASP GenAI Security Project LLM06:2025, MITRE ATLAS release 5.6.0 and OpenAI's practical guide to building agents. The middle column is this site's wording.

| Limit | What the team sets | Source text |
|---|---|---|
| Scope | A named list of systems, versions and kinds of change per tool | OWASP LLM06: "Avoid the use of open-ended extensions where possible (e.g., run a shell command, fetch a URL, etc.)" |
| Permission | The least identity each downstream system needs, enforced by that system and not by the prompt | OWASP LLM06: limit permissions "to the minimum necessary" |
| Approval | Which actions wait for a named person, set by consequence | MITRE ATLAS AML.M0029: human-in-the-loop policies "should follow the degree of consequence of the task at hand" |
| Stop condition | Retry and action limits, and a person told when they trip | OpenAI: "Exceeding failure thresholds: Set limits on agent retries or actions." OWASP: implement rate-limiting |

## A graded tool list for one agent

OpenAI's guide says to rate each tool low, medium or high "based on factors like read-only vs. write access, reversibility, required account permissions, and financial impact", and to use the rating to trigger a pause or a human. The list below applies that to an agent whose job is to find Node.js services affected by CVE-2026-111497 and prepare fixes. CVE-2026-111497 is an out-of-bounds write in the Brotli decoder bundled with Node.js: malformed compressed input that an application decompresses with node:zlib can corrupt process memory, which can lead to a crash, disclosure of process memory or remote code execution ([NVD record](https://nvd.nist.gov/vuln/detail/CVE-2026-111497); Node.js rates it high and says it affects 22.x, 24.x and 26.x). Node.js disclosed it on 21 Oct 2026 and CISA added it to the KEV catalog on 27 Oct 2026. The fixed versions are Node.js 22.23.4, 24.22.1 and 26.12.1 ([Node.js security releases, October 2026](https://nodejs.org/en/blog/vulnerability/october-2026-security-releases)).

Nine tools for one agent. Grades and rules are this site's example; CVE description from the NVD record, fixed versions from the Node.js advisory, KEV date from CISA's catalog, read 19 Nov 2026.

| Tool | Access | Undo | Identity | Grade | Rule |
|---|---|---|---|---|---|
| list_services | Read inventory | Not needed | Read-only inventory token | Low | Automatic |
| read_repo | Read files | Not needed | Read-only, repositories in the inventory only | Low | Automatic |
| fetch_advisory | Read from an allow-list: nodejs.org, NVD, CISA, the Brotli repository | Not needed | No credentials | Low | Automatic; output is outside text, so it goes to a fact sheet a person confirms |
| run_tests | Executes code | Delete the sandbox | Sandbox with no secrets and no network egress | Medium | Automatic, sandbox only |
| edit_branch | Writes files, only on branches named agent/cve-2026-111497-* | Delete the branch | Repository token scoped to that prefix; no access to workflow or deployment files | Medium | Automatic after the fact sheet is confirmed |
| open_pull_request | Writes a PR | Close the PR | Same token, no merge right | Medium | Automatic; a developer reviews |
| draft_proxy_ticket | Writes a ticket proposing a rule rejecting Content-Encoding br | Close the ticket | Ticket system, create only | Medium | Automatic; the rule is applied by a person |
| merge_pull_request | Writes to a protected branch | Revert commit | Not issued to the agent | High | Withheld: a developer merges |
| deploy_or_restart | Changes running systems | Redeploy | Not issued to the agent | High | Withheld: release owner acts |

Three choices in the table carry most of the protection. Version choice is not the agent's: scope lists only the three fixed versions. Node.js 20.x, 23.x and 25.x are end-of-life lines (end dates 30 Apr 2026, 1 Jun 2025 and 1 Jun 2026 in the Node.js release schedule), and the Node.js advisory says end-of-life versions are always affected and lists fixes only for 22.x, 24.x and 26.x. A service on one of those lines becomes an issue for a person to move it to a supported line. A Node.js upgrade also fixes only the Node.js copy of Brotli, so the repository check must look for other copies. The stopgap of rejecting Brotli requests at the proxy costs clients that send Brotli, which is why it is a ticket and not an action.

## What each limit's record looks like

Each limit is a line in a policy file that the tool layer reads, not a sentence in the prompt, and each decision leaves a log line. The file and lines below are constructed for the agent above; the field names are this site's. The deny at 09:16:51 halts run r-0412 for good. The notified release owner starts a new run, r-0413, at 09:30:02 for the next service, and that run hands orders-api over because Node.js 20.x has no fix.

```yaml
# agent-policy.yaml, patch-response agent, version 2026-10-28.1
tools:
  edit_branch:
    scope:     repos in the inventory; branches agent/cve-2026-111497-*; no paths under .github/ or deploy/
    identity:  repo-token-agent-branches (no merge right, no protected branches)
    approval:  fact sheet confirmed, approval ID required on every call
    stop:      max_edit_test_cycles 3 per service; max_tool_calls 25 per service
  merge_pull_request: withheld
  deploy_or_restart:  withheld
run_limits:
  max_services_per_run: 40
  max_agent_prs_per_hour: 5
  on_stop: halt the run, notify the release owner
```

```text
2026-10-28T09:14:07Z run=r-0412 svc=billing-api tool=edit_branch decision=allow limit=scope path=package.json cycle=2 calls=11 approval=FS-111497-01
2026-10-28T09:16:51Z run=r-0412 svc=billing-api tool=edit_branch decision=deny limit=scope path=.github/workflows/ci.yml action=halt notify=release-owner
2026-10-28T09:30:02Z run=r-0413 started_by=release-owner svc=orders-api tool=none
2026-10-28T09:31:20Z run=r-0413 svc=orders-api tool=none decision=handover limit=stop reason=node-20.x-no-fix
```

Records and checks for the four limits on the Node.js agent. Constructed example; the CVE dates and versions are from the Node.js advisory and CISA's KEV catalog, read 19 Nov 2026.

| Limit | Where it is recorded | How a breach is detected |
|---|---|---|
| Scope | The `scope` line in the policy and `limit=scope` on every allow or deny | A deny line means the tool layer held. A breach is a commit or branch by the agent's token outside the allowed prefix in the repository's own audit log, compared with the policy each day |
| Permission | The `identity` line; the downstream system's own record of calls by that identity | A weekly test attempts a merge as the agent's identity and expects a refusal. A success is a breach of permission, whatever the policy file says |
| Approval | An `approval=` ID on every write line | Join the downstream audit log of writes to the approval IDs. A write with no matching ID is a breach |
| Stop condition | `cycle=` and `calls=` counters on each line; a `halt` line when a limit trips | A run whose last line shows `calls=` or `cycle=` above the policy's limits with no `halt` line means the stop did not fire; page the release owner |

## Keep outside text away from the write tools

MITRE ATLAS ("Restrict AI Agent Tool Invocation on Untrusted Data") says tool invocation "be restricted or limited when untrusted data enters the LLM's context", and suggests blocking automatic invocation or requiring user confirmation. An advisory page is outside text. So the agent runs in two stages. The read stage has fetch_advisory and no write tool; it ends in a fact sheet listing affected lines, fixed versions and the source URL. A person compares the sheet with the vendor advisory, which takes a few minutes. The write stage receives only the fact sheet, has no fetch tool, and holds edit_branch and open_pull_request. The pattern is in [tools and permissions](/agent-harness/tools-and-permissions/).

The person's check is the weak point, and it fails in three ways. The reviewer compares the sheet with the agent's own fetched copy of the advisory, so a misread or altered page reaches both sides. The reviewer approves without opening the vendor page. Or a version is mistyped, such as 22.23.4 read as 22.32.4, and the branch is edited to a version that does not exist. Two controls do not rely on attention. The reviewer types the three fixed versions from the Node.js advisory into the approval form, and `edit_branch` accepts only a target equal to an entry in that form. And the approval line records the vendor URL the reviewer opened, as `checked=nodejs.org/en/blog/vulnerability/october-2026-security-releases`.

## Where the stop values come from

The numbers in the policy file above are example values to adjust after the first eval run (see [AI agent evals](/guides/ai-agent-evals/)). Each stop ends the run and tells a named person. The per-run caps exist so that a wrong rule shows up in a small batch, which is the rate-limiting OWASP describes. Two stops have no number: any attempt to touch a path outside the allowed ones, or any tool call not on the list, halts the run and is logged; and a service the inventory cannot place, or a Node.js line with no fix, is handed over untouched.

Which tools may later run without a person is decided by rating each action, as in [autonomy levels](/guides/autonomy-levels/). What an approver needs on screen is in [human approval design](/guides/human-approval-design/).

## Sources

- [OWASP GenAI Security Project, LLM06:2025 Excessive Agency](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/), read 19 Nov 2026
- [MITRE ATLAS mitigations, atlas-data release 5.6.0 (ATLAS.yaml)](https://github.com/mitre-atlas/atlas-data/blob/main/dist/ATLAS.yaml), read 19 Nov 2026
- [OpenAI, A practical guide to building agents](https://cdn.openai.com/business-guides-and-resources/a-practical-guide-to-building-agents.pdf), read 19 Nov 2026
- [Node.js, October 2026 security releases](https://nodejs.org/en/blog/vulnerability/october-2026-security-releases), read 19 Nov 2026
- [CISA, Known Exploited Vulnerabilities catalog, CVE-2026-111497](https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-111497), read 19 Nov 2026
- [Node.js Release Working Group, release schedule (end-of-life dates for 20.x, 23.x, 25.x)](https://github.com/nodejs/Release/blob/main/schedule.json), read 19 Nov 2026
- [NIST NVD, CVE-2026-111497 record](https://nvd.nist.gov/vuln/detail/CVE-2026-111497), read 19 Nov 2026

Last reviewed 19 Nov 2026

Canonical: https://agenticaiincybersecurity.com/guides/ai-agent-guardrails/
