# Stop and Handover Conditions for a Security Agent

Stop conditions are the limits that make an agent halt and hand its job to a person: a retry cap, a cap on calls per run, a cap on writes per hour, and a list of unexpected results. In the worked case below, 3 failed checks stopped a run at 09:21 and a person acted 17 minutes later.

## The question

**Q07.** What makes the agent stop and hand over (retry limits, rate limits, unexpected tool results), and who is paged when it does?

A good answer contains four things.

- Numbers, not adjectives: for example 3 failed tool calls on one finding, 25 tool calls per run, 10 write actions per hour per queue. The sources name the kinds of limit; the values are yours to set.
- A list of unexpected results that count as a stop even when no error occurs: a tool returns data in a shape the agent was not given, an asset is outside the stated scope, a check contradicts the tool's own success message.
- A destination for the handover: a queue with an owner, an on-call page, and what the agent writes there (what it tried, what it saw, what it left unchanged).
- A statement of what the agent does after stopping: nothing further, with its partial changes listed.

## Three limits from three sources

Stop-related clauses, read 19 Nov 2026. OpenAI lists the first as one of two triggers for human intervention; the other is high-risk actions, covered on human approval points.

| Limit | Wording in the source | Source |
|---|---|---|
| Failure threshold | "Exceeding failure thresholds: Set limits on agent retries or actions." | [OpenAI, A practical guide to building agents](https://cdn.openai.com/business-guides-and-resources/a-practical-guide-to-building-agents.pdf) |
| Iteration cap | "it's also common to include stopping conditions (such as a maximum number of iterations) to maintain control" | [Anthropic, Building effective agents](https://www.anthropic.com/engineering/building-effective-agents) |
| Action rate | "Implement rate-limiting to reduce the number of undesirable actions that can take place within a given time period" | [OWASP LLM06:2025](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/) |

They bound different things. A retry cap stops one task from looping. An iteration cap bounds one run. A rate limit bounds how many changes the agent can make across all tasks in a window, which in OWASP's words increases "the opportunity to discover undesirable actions through monitoring before significant damage can occur." OWASP lists rate limiting among options that "will not prevent Excessive Agency, but can limit the level of damage." MITRE ATLAS mitigation AML.M0032 also names "rate limiting of tool invocation" among its ways to set boundaries around agent tools ([ATLAS data 5.6.0](https://github.com/mitre-atlas/atlas-data/blob/main/dist/ATLAS.yaml)).

## Worked case: a fix that looked done and was not

The job: for CVE-2026-123158 (OpenSSH before 10.6p2, password bypass on musl systems without PAM), propose an Alpine package upgrade on 23 hosts. The CVE record gives CVSS 3.1 base score 8.1; NVD shows no CVSS rating of its own ([NVD](https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-123158)). The CVE was published 5 Nov 2026, GreyNoise first observed exploitation on 7 Nov ([GreyNoise](https://sshole.events.greynoise.io/)) and CISA added it to the KEV catalog on 9 Nov ([CISA KEV](https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json)). The run below is on 10 Nov 2026. OpenSSH fixed the flaw upstream in 10.6p2. Alpine did not move its stable branches to 10.6p2: its advisory says the stable-branch packages "carry a patch for the same problem", so Alpine 3.21 stays on OpenSSH 9.9p2 and the fixed package is 9.9_p2-r1 (a backport; the version string still reads 9.9). The advisory also says sshd must be restarted after the upgrade, because upgrading alone does not replace the running daemon ([Alpine advisory](https://alpinelinux.org/posts/2026-11-05-openssh-password-authentication-bypass/)). Limits set: 3 failed post-change checks per finding, 25 tool calls per run, 10 writes per hour.

Alpine advisory of 5 Nov 2026, read 19 Nov 2026. Every release checked is affected, from 3.16 to 3.24 and edge. Point releases 3.21.10, 3.22.8, 3.23.8 and 3.24.4 contain the fixed packages; 3.16 to 3.20 have the packages but no new point release. Compare the installed package with this table, not with the OpenSSH banner: the backports keep older version strings.

| Alpine branch | Fixed openssh package |
|---|---|
| edge | 10.6_p2-r0 |
| 3.24 | 10.3_p1-r2 |
| 3.23 | 10.2_p1-r1 |
| 3.22 | 10.0_p1-r11 |
| 3.21 | 9.9_p2-r1 |
| 3.20 | 9.7_p1-r6 |
| 3.19 | 9.6_p1-r3 |
| 3.18 | 9.3_p2-r4 |
| 3.17 | 9.1_p1-r7 |
| 3.16 | 9.0_p1-r6 |

Illustrative timeline for a hypothetical environment; the CVE dates and the restart requirement are from the sources named above.

| Time | Event | Calls used / writes used |
|---|---|---|
| 09:12 | Run starts on host 1, staging | 0 / 0 |
| 09:18 | Package upgraded to 9.9_p2-r1 (the only write) | 9 / 1 |
| 09:19 | Post-change check 1 fails: package version is fixed, but the sshd process started at 08:02, before the upgrade | 10 / 1 |
| 09:20 | Check 2 fails, same reading; agent has no restart tool in its register | 12 / 1 |
| 09:21 | Check 3 fails; failure cap reached; agent stops and pages the on-call engineer | 14 / 1 |
| 09:26 | On-call engineer acknowledges (5 minutes) |  |
| 09:38 | Engineer restarts sshd on host 1; the check passes (17 minutes after the stop) |  |

What the caps bought: the agent touched 1 of 23 hosts. With only the write limit of 10 per hour it would have upgraded 10 hosts in the first hour, each showing the fixed package version while sshd kept running the old code. With no limit at all it would have reported 23 of 23 fixed. The check that compared the process start time with the install time, not the agent's own success message, is what turned a retry into a stop.

The handover note the agent wrote to the SEC-VULN queue:

**Handover: CVE-2026-123158, run 10 Nov 2026 09:12 to 09:21**

- Reason for stop: 3 failed post-change checks (limit 3) on host alp-stg-01
- Tried: apk upgrade of openssh-server to 9.9_p2-r1 at 09:18; checked package version and sshd process start time at 09:19, 09:20, 09:21
- Saw: package version is fixed; sshd started 08:02, before the upgrade; the running daemon is still the old code
- Changed: 1 package upgrade on alp-stg-01. Nothing else. 22 hosts untouched
- Not changed: no restart (no restart tool in scope), no config edits
- Needs a person: restart sshd on alp-stg-01, confirm the check passes, then say whether the restart may become a tool
- Paged: on-call, security operations, 09:21
- Transcript: run id and link

## How to test it on your own systems

1. In staging, lower the retry cap to 1 and give the agent a task it cannot complete. Confirm it stops, writes a note with the fields above and pages the named person within the time you wrote down.
2. Lower the write-rate limit below what a normal batch needs. Confirm further writes are refused rather than queued without bound.
3. Hand the note to someone who was not in the run. Can they say what state the systems are in without opening the transcript?
4. Record the time from stop to a human acting. In the case above that is 17 minutes; that interval, not the limit value, is the exposure window.
5. Add each real handover to the test set described on [success criteria and test sets](/evaluation-checklist/success-criteria-and-test-sets/). OpenAI notes that early human intervention helps "identify failures" and "uncover edge cases".

A stop is not a rollback: partial changes persist. [Kill switch and rollback](/evaluation-checklist/kill-switch-and-rollback/) covers undoing them, and [evidence and audit trail](/evaluation-checklist/evidence-and-audit-trail/) covers the record the on-call person reads.

## Sources

- [OpenAI, A practical guide to building agents, human intervention](https://cdn.openai.com/business-guides-and-resources/a-practical-guide-to-building-agents.pdf), read 19 Nov 2026
- [Anthropic, Building effective agents](https://www.anthropic.com/engineering/building-effective-agents), read 19 Nov 2026
- [OWASP, LLM06:2025 Excessive Agency](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/), read 19 Nov 2026
- [MITRE ATLAS data 5.6.0, mitigation AML.M0032](https://github.com/mitre-atlas/atlas-data/blob/main/dist/ATLAS.yaml), read 19 Nov 2026
- [Alpine Linux, OpenSSH password authentication bypass advisory, 5 Nov 2026](https://alpinelinux.org/posts/2026-11-05-openssh-password-authentication-bypass/), read 19 Nov 2026
- [CISA, Known Exploited Vulnerabilities catalog, CVE-2026-123158 entry](https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json), read 19 Nov 2026
- [NVD, CVE-2026-123158 record](https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-123158), read 19 Nov 2026
- [GreyNoise, event page and timeline for CVE-2026-123158](https://sshole.events.greynoise.io/), read 19 Nov 2026

Last reviewed 19 Nov 2026

Canonical: https://agenticaiincybersecurity.com/evaluation-checklist/stop-and-handover-conditions/
