At a glance
- Prose is context; hooks are code. One major harness delivers instruction files as a user message and says "to block an action regardless of what Claude decides, use a PreToolUse hook instead" [3]. Anything that must always happen goes in a hook, permission rule or policy engine.
- Use the same eight interception points everywhere: session start and end, user input, before and after model call, before and after tool call, sub-agent or handoff, compaction, error, and stop or completion. Every major framework now exposes these under different names [1][4][7][9][11].
- Hooks enforce; the policy engine decides. A before-tool hook is the enforcement point that asks the policy engine (Cedar grants, plan 10B) for a decision with identity context, and applies it. Keep hard deny lists in the permission system or policy, not only in hook logic [1].
- Policy hooks fail closed, observability hooks fail open. Defaults differ by framework: in one harness only exit code 2 blocks, every other failure lets the action proceed unless
onFailure: "block"is set [1]. Set it explicitly. - Set timeouts deliberately. One harness defaults command hooks to 600 seconds [1]; a policy hook should answer in well under a second, and a timeout must deny.
- Deliver policy hooks centrally and make them non-overridable, through managed settings or runtime-wide plugins, with HTTP hook endpoints allowlisted [1][9]. Block agents from writing hook configuration [16].
- Test hooks like any other security control: decision fixtures, malformed input, timeouts, crashes, ordering with other hooks, and an end-to-end red-team case per hook.
Scope and where it sits
This guide covers lifecycle extension points in agent harnesses and frameworks: which events exist, what each is for, what belongs in a hook versus a prompt, the policy engine or the gateway, how hooks fail and perform, and how to test and distribute them.
In the 10-layer reference architecture (plan section 4), hooks run in layer 4, agent runtime, and are the place where layer 9, trust, safety and policy is enforced inside the loop; gateway checks in layer 2 and policy decisions in layer 9 sit alongside them. In the Anatomy crosswalk, hooks implement system 2, Executive function ("lifecycle hooks, and gates that keep orchestration testable") and system 9, Proprioception ("step validators and guards wired into each building block").
Covered elsewhere:
- What guardrail classifiers check (injection, PII, toxicity): Guardrails.
- The tools hooks wrap and their risk tiers: Tool design and MCP servers.
- Pausing for human approval durably: Agent runtime and durable execution.
- Trace attributes emitted from hooks: Observability and tracing.
- Isolation of the processes hooks run in: Sandboxing and code execution.
When to use what
Interception points across frameworks (examples, not a complete list).
| Point | Typical CoE use | Claude Code and Agent SDK [1][2] | OpenAI Agents SDK [4][5][6] | LangChain v1 [7][8] | Google ADK [9][10] | Microsoft Agent Framework [11] |
|---|---|---|---|---|---|---|
| Session or run start and end | Load policy version, start trace, final audit | SessionStart, SessionEnd | on_agent_start, on_agent_end (observe only) | before_agent, after_agent | before_run, after_run | Agent middleware |
| User input | Classification, redaction, input guardrail | UserPromptSubmit (context only, cannot replace prompt) | Input guardrails (first agent) | before_agent | on_user_message (can replace) | Agent middleware |
| Before and after model call | Redaction, cost metering, fallback, format checks | PreModelSwitch, PostModelSwitch; MessageDisplay | on_llm_start, on_llm_end (observe only) | before_model, after_model, wrap_model_call | before_model, after_model | Chat middleware |
| Before tool call | Allow, deny, ask or defer; rewrite arguments; approvals | PreToolUse (allow, deny, ask, defer; updatedInput) | Tool input guardrails; needs_approval | wrap_tool_call | before_tool (return value skips tool) | Function middleware |
| After tool call | Sanitise output, tokenise PII, log | PostToolUse (updatedToolOutput), PostToolUseFailure | Tool output guardrails | wrap_tool_call | after_tool | Function middleware |
| Error | Fallback, alert, safe stop | StopFailure, PostToolUseFailure | error_handlers (max turns, refusal, invalid output) | Tool and model retry middleware | on_model_error, on_tool_error | Middleware exception handling |
| Sub-agent or handoff | Scope and model checks for the delegate | SubagentStart, SubagentStop | on_handoff (tool guardrails do not cover handoffs) | Subagent middleware | before_agent on sub-agent | Agent middleware per agent |
| Compaction | Archive transcript, keep audit facts | PreCompact, PostCompact | n/a in opened docs | Summarisation middleware | n/a in opened docs | n/a in opened docs |
| Stop or completion | Quality gate: tests and linters before "done" | Stop, TaskCompleted | Output guardrails (last agent) | after_agent | after_run | Agent middleware |
Where a rule should live.
| Option | Use when | Avoid when | Cost and latency notes |
|---|---|---|---|
| Prompt instruction | Guidance, style, preferences, explanations of why a rule exists | The rule must always hold | No added latency; adherence is probabilistic [3][13] |
| Hook (in-process or command) | Deterministic local checks, redaction, argument rewriting, logging, quality gates | Decision needs organisation-wide identity, entitlements or cross-agent state | Adds per-event latency; shell hooks pay process start-up each call |
| Hook calling a policy engine | Authorisation with identity, resource and context (plan 10B Cedar grants) | Simple static checks a local rule can do | One network call per guarded event; cache decisions where policy allows |
| Permission system or allow/deny rules | Hard allow or deny on tools and paths | Context-dependent decisions | Cheapest enforcement; one harness recommends it over hooks for hard allow or deny [1] |
| Gateway (layer 2) | Rate limits, budgets, model allowlists, injection screening across all agents | Decisions needing in-loop tool arguments | Shared across agents; catches what in-process hooks miss |
| Guardrail classifier (via hook) | Content judgements: injection, PII, toxicity | Deterministic rules a regex or schema can express | Classifier latency; run in blocking mode for security [4] |
Decision criteria
- Must it always hold? Yes: hook, permission rule or policy, never prompt alone. No: prompt.
- Does the decision depend on who is acting, on what resource, under which grant? Yes: the hook calls the policy engine. No: a local hook or permission rule.
- Should a failure stop the action? Security, data protection, money movement or irreversible actions: fail closed. Telemetry, notifications, analytics: fail open, asynchronously.
- Does it need to see or change tool arguments? Yes: before-tool hook with argument rewrite (for example redirecting writes to a sandbox path [2]). Only observe: after-tool or async logging.
- Must it run before tokens or tools are spent? Yes: blocking mode. In one SDK, input guardrails run in parallel by default, so the agent may already have used tokens or run tools when the tripwire fires [4].
- Does it apply to every agent, model and tool? Yes: deliver as a runtime-wide plugin or managed hook (one framework's plugins take precedence over agent callbacks [9]). No: agent-level callback.
- Is a human needed? Yes: the hook returns ask or defer and hands off to a durable approval flow; it does not block a thread waiting [2][6].
- Will it run on a hot path at volume? Yes: in-process function, cached policy decisions, strict timeout. No: a command or HTTP hook is acceptable.
Reference patterns
Pattern 1: Policy enforcement point on every tool call
Problem. The agent decides which tools to call; nothing outside the model checks whether this principal may call this tool with these arguments now.
How it works. A before-tool hook builds a request from the tool name, arguments, the agent's identity and the delegated user (plan 10A), the tool's risk tier and the run's budgets, and asks the policy engine for permit or deny (plan 10B). Permit continues; deny returns a reason the model can read so it does not retry blindly [2]; high-tier actions return ask or defer to route to approval. Every decision is logged with the policy version. Where several hooks run, the most restrictive decision wins: one SDK documents deny over defer over ask over allow, and notes that all matching hooks run in parallel in non-deterministic order [2].
# Generic before-tool hook (framework-neutral sketch)
def before_tool(event):
req = {
"principal": event.agent_id, "on_behalf_of": event.user_id,
"action": event.tool_name, "resource": resource_of(event.args),
"context": {"tier": tier(event.tool_name), "run_spend": event.run_spend},
}
try:
decision = pdp.authorize(req, timeout_s=0.5)
except Exception:
return deny("policy service unavailable") # fail closed
audit.log(req, decision, policy_version=decision.version)
if decision.effect == "deny":
return deny(decision.reason) # model sees the reason
if decision.requires_approval:
return defer("approval required") # durable approval path
return allow()
When to use. Every agent with write, money-moving or external-communication tools; all A2 and above autonomy levels (plan 14).
Pitfalls. In one harness, a command hook that exits with code 1 or times out does not block unless onFailure: "block" is set [1]. Tools that bypass the hook pipeline (one SDK's hosted tools and handoffs are not covered by its tool guardrails [4]) need enforcement elsewhere, for example in the tool server. Programmatic tool calling makes per-call client hooks coarser, so authorisation also has to live in the tool server (plan 4B).
Pattern 2: Redaction and tokenisation at the boundaries
Problem. Personal or confidential data flows from users and tools into model calls, traces and memory.
How it works. A user-input hook classifies and redacts; a before-model hook applies the final redaction pass; an after-tool hook tokenises PII in tool results so the model sees placeholders and downstream tools receive real values through a vault. One harness lets a post-tool hook replace the tool's result before the model sees it (updatedToolOutput) [2]; one framework's on_user_message plugin can replace the user message [9]; another ships PII detection middleware [8].
When to use. Any agent handling regulated data; mandatory where traces leave the client's boundary.
Pitfalls. Some input hooks can only add context, not replace the prompt (one harness's UserPromptSubmit [1]), so redaction may need to happen in the client or gateway instead. Over-redaction breaks tasks; evaluate task success with redaction on.
Pattern 3: Asynchronous audit and telemetry hooks
Problem. Logging every event synchronously adds latency, and a logging outage must not stop the business.
How it works. Observability hooks emit events (with tool use IDs to correlate before and after [2]) to a local buffer or queue and return immediately. One SDK supports an async return so the agent proceeds without waiting; async outputs cannot block or modify the operation [2]. Hooks fail open, but buffer locally and alert on drop rate.
When to use. All agents, for trace enrichment, cost metering and audit trails.
Pitfalls. If audit is a regulatory duty, a silent drop is a compliance failure: monitor completeness and, for high-tier actions, write the audit record synchronously in the policy hook (Pattern 1). Hook output fed back to the model is capped (10,000 characters in one harness) and long output is saved to a file the model is not asked to read [1].
Pattern 4: Completion quality gate
Problem. Agents declare work done when tests fail or required artefacts are missing.
How it works. A stop or completion hook runs deterministic checks (tests, linters, schema validation, required sign-offs) and, if they fail, blocks completion with a message telling the agent what to fix. One harness also offers a TaskCompleted event for "require passing tests before a task closes" [2].
When to use. Coding agents, document generation, any task with an objective definition of done.
Pitfalls. A stop hook that always blocks creates a loop; cap retries and escalate. In one harness, onFailure has no effect on Stop hooks, and a timed-out Stop callback counts as no decision [1][2], so a crashed gate lets the agent stop: alert on gate failures.
Pattern 5: Approval deferral into a durable flow
Problem. A hook that waits synchronously for a human holds resources, times out, and loses the approval if the process restarts.
How it works. The before-tool hook returns ask or defer. In one SDK, defer ends the turn with a tool_deferred stop reason so the call can be resumed later [2]; in another, tools marked needs_approval pause the run, the state is serialised, and the run resumes after approve or reject [6]. The approval itself lives in the durable runtime (see Agent runtime and durable execution).
When to use. Any action at or above the approval threshold for the agent's autonomy level (plan 14.2).
Pitfalls. Approval does not guarantee exactly-once execution; one SDK's docs say so explicitly and recommend idempotency keys for consequential actions [6]. Approval callbacks that cannot inspect arguments safely should require manual approval, as one SDK does by default [6].
Pattern 6: Centrally managed, non-overridable hook pack
Problem. Teams copy hooks into projects, disable them when inconvenient, or an agent edits its own hook configuration.
How it works. Policy hooks ship as one versioned pack through managed settings or a runtime-wide plugin registered once. In one harness, allowManagedHooksOnly blocks user, project and plugin hooks except force-enabled managed plugins, lower scopes cannot disable managed hooks, and allowedHttpHookUrls restricts where HTTP hooks may call [1]. In one framework, plugins registered on the runner apply to every agent, model and tool call and take precedence over local callbacks [9]. Sandboxes block agent writes to hooks, skills and MCP configuration; NVIDIA's red team lists this as mandatory and notes hooks often run outside the sandbox [16].
When to use. Every enterprise deployment; this is part of the plan's enterprise harness.
Pitfalls. A 2026 disclosure showed a prompt injection reaching persistent memory and global hook configuration on a developer machine [15]; integrity-monitor hook configuration. Plugin precedence means a buggy plugin silently skips agent callbacks [9]; test the combination, not each in isolation.
Recommended defaults
| Setting | Default | Range or options | Why |
|---|---|---|---|
| Policy hook failure mode | Fail closed (block on crash, timeout or invalid output) | None for high-tier tools | Plan 4B; one harness defaults to continue unless onFailure: "block" [1] |
| Observability hook failure mode | Fail open, async, with local buffer | Sync for regulated audit of high-tier actions | Async outputs cannot block or modify [2] |
| Policy hook timeout | 500 ms to 2 s, deny on timeout (practitioner default) | Up to 5 s for remote PDP | Harness defaults (600 s for command hooks) are far too long for policy [1] |
| Blocking exit semantics (command hooks) | Use exit code 2 or JSON deny for blocks | n/a | Exit code 1 is non-blocking in one harness [1] |
| Input guardrails mode | Blocking for security checks | Parallel for low-risk checks | Parallel mode may spend tokens and run tools before tripping [4] |
| Decision precedence | Most restrictive wins (deny over defer over ask over allow) | n/a | Documented behaviour in one SDK [2]; replicate in custom frameworks |
| Hook delivery | Managed settings or runtime-wide plugin, version-pinned | Project hooks only for non-policy use | Lower scopes cannot disable managed hooks [1]; plugins apply runtime-wide [9] |
| HTTP hook endpoints | Allowlisted | n/a | allowedHttpHookUrls pattern [1] |
| Hook config writes by agents | Blocked by sandbox | Manual user edit only | NVIDIA mandatory control [16] |
| Deny message | Plain reason the model can act on | n/a | Reason tells the model why so it avoids retrying [2] |
| Repeated denial handling | Escalate to a human after N consecutive denials (practitioner default N=3) | 2 to 5 | Plan 14A response ladder |
| Hook output size to model | Keep under 2,000 characters (practitioner default) | Hard cap 10,000 in one harness | Long output is not read by the model [1] |
| Test coverage | Every hook has decision fixtures including fail-closed cases | n/a | Plan 4B per-block eval matrix |
Anti-patterns
- "Always ask before deleting" written in the system prompt. Probabilistic. Fix: before-tool hook or permission rule.
- Policy hook exits with code 1 on error. In one harness this lets the action proceed [1]. Fix: exit 2 or JSON deny, and
onFailure: "block". - Relying on a slow hook to stall a risky call. A timed-out command hook may not block [1]. Fix: explicit timeout with deny.
- Parallel input guardrail for a security check. The agent can act before the tripwire fires [4]. Fix: blocking mode.
- Hooks that call the model for decisions that a rule can make. Slower, costlier, non-deterministic. Fix: deterministic code; reserve prompt or agent hooks for judgements.
- Hooks that depend on each other's order. Matching hooks may run in parallel in non-deterministic order [2]. Fix: make each hook independent; compose in one hook if order matters.
- Project-level hooks that developers can disable. Fix: managed, non-overridable delivery [1][9].
- Terminating the tool loop mid-call without cleaning up. One framework warns this can leave chat history with a function call and no result, making it unusable [11]. Fix: return a synthetic tool result explaining the block.
- Hook config writable by the agent. A persistence path for attackers [15][16]. Fix: sandbox write block and integrity monitoring.
Sizing and cost notes
Hooks cost latency more than money. The drivers are the number of guarded events per run, the hook type, and whether a hook calls a remote service or a model.
Illustrative latency budget. An agent run with 30 tool calls and 31 model calls:
- In-process function hooks at about 1 ms each: about 60 ms per run for one before and one after hook on each tool call. Negligible.
- Shell command hooks at an illustrative 30 to 80 ms process start-up each: 60 tool events x 50 ms = about 3 seconds per run. Noticeable; prefer in-process callbacks or a long-lived hook server for hot paths.
- Remote policy decision at an illustrative 20 ms p50 and 150 ms p99 on 30 before-tool calls: about 0.6 seconds at p50, up to 4.5 seconds in the worst case if every call hits p99. Cache permit decisions within a run where policy allows.
- A guardrail classifier or prompt-type hook (single-turn model call): hundreds of milliseconds to seconds each, plus tokens. One harness defaults prompt hooks to 30 seconds and agent hooks to 60 seconds [1]. Use only where a judgement is needed.
Concurrency. One harness runs all matching hooks in parallel and caps prompt or agent hooks at 12 concurrent, queuing the rest [1]. Account for this when sizing hook servers.
Token cost. Hook output injected as context (deny reasons, additional context) adds tokens to the next model call and sits below the cache breakpoint. Keep it short.
Security and compliance hooks
Threats (OWASP Agentic Top 10 [14] and LLM Top 10 2025).
- ASI02 Tool Misuse and LLM06 Excessive Agency: hooks are the in-loop control that stops a legitimate tool being used harmfully. Controls: Pattern 1 on every tool, risk-tier routing, approval deferral.
- ASI01 Agent Goal Hijack and LLM01 Prompt Injection: an injected instruction leads to a tool call. Controls: enforcement outside the model; argument validation in before-tool hooks.
- ASI03 Identity and Privilege Abuse: hooks must evaluate the delegated identity, not only the agent (plan 10A).
- ASI04 Agentic Supply Chain: third-party hook packs and plugins, and tampering with hook configuration [15][16]. Controls: pinned sources, managed-only hooks, review of hook code, write blocks.
- ASI08 Cascading Failures: a hook outage that fails open across a fleet. Controls: fail closed for policy, circuit breakers, alerting on hook error rate.
- LLM02 Sensitive Information Disclosure: redaction and tokenisation hooks (Pattern 2).
Data protection. Hooks see full tool arguments and results, often including personal data. Hook logs fall under the same retention and redaction rules as traces; HTTP hooks must not forward secrets in headers except from an allowlist of environment variables [1].
Audit evidence to keep. Hook pack version per run; every policy decision with request, decision, policy version and latency; denials and escalations; approvals with approver identity; hook error and timeout counts; test reports for each hook release.
Governing plan sections. 4B (hooks and enterprise harness), 10 (controls and red teaming), 10A (identity in hook requests), 10B (Cedar grants evaluated from hooks), 14 (approval patterns), 14A (envelope bounds enforced by hooks, response ladder), 13 (registry entries for hook packs), and the ROE (to be defined, plan section 12), whose enforcement hooks the plan places in layer 9.
Test and eval checklist
| ID | Stage | Area | Check | Pass criteria | Priority |
|---|---|---|---|---|---|
| HK-01 | Design | Rule placement | Each rule classified as prompt, permission, hook, policy engine or gateway | Rule register approved with rationale per rule | Must |
| HK-02 | Design | Failure mode | Failure mode and timeout set per hook | Every hook has documented open or closed behaviour and timeout | Must |
| HK-03 | Design | Coverage | All tool paths mapped to an enforcement point, including handoffs, hosted tools and sub-agents | No unguarded path, or compensating control documented | Must |
| HK-04 | Build | Unit tests | Decision fixtures for every hook | 100% of fixtures return expected decision | Must |
| HK-05 | Build | Robustness | Malformed, oversized and unexpected input | Policy hooks deny, observability hooks no-op; agent never crashes | Must |
| HK-06 | Build | Independence | Hooks do not rely on execution order | Tests pass with randomised hook order | Should |
| HK-07 | Test | Fail closed | Policy hook crash, non-zero exit and invalid output | Action blocked in every case | Must |
| HK-08 | Test | Timeout | Policy hook exceeds timeout | Action blocked and timeout logged | Must |
| HK-09 | Test | Dependency outage | Policy engine unavailable | All guarded actions denied and alert raised | Must |
| HK-10 | Test | Fail open | Observability hook failure | Agent continues; drop counted and alerted | Should |
| HK-11 | Test | Precedence | Conflicting decisions from several hooks on one event | Most restrictive decision applied regardless of completion order | Must |
| HK-12 | Test | Argument rewrite | Rewritten tool arguments | Tool receives rewritten arguments; original logged | Should |
| HK-13 | Test | Guardrail mode | Security input guardrails run blocking | No tool executes before the guardrail verdict | Must |
| HK-14 | Test | Quality gate | Completion gate with failing checks | Agent cannot finish; escalates after retry cap | Should |
| HK-15 | Test | Approval deferral | Deferred approval across process restart | Run resumes correctly after approval | Must |
| HK-16 | Test | Redaction | PII in inputs, tool results, traces and memory | Zero PII hits in sampled outputs | Must |
| HK-17 | Test | Config tamper | Agent attempts to write hook, skill or MCP configuration | Write blocked by sandbox | Must |
| HK-18 | Test | Injection | Prompt injection cases targeting guarded tools | No high-tier action without a permit | Must |
| HK-19 | Test | Performance | Hook latency under load | Hook p99 within budget; total overhead within run SLO | Should |
| HK-20 | Release | Delivery | Hook pack versioned, pinned and delivered via managed settings or runtime plugin | Lower scopes cannot disable or override it | Must |
| HK-21 | Release | Endpoints | HTTP hook endpoints and forwarded variables allowlisted | Calls to other URLs refused | Must |
| HK-22 | Release | Review | Hook code reviewed as security-sensitive code | Two-person review recorded | Should |
| HK-23 | Run | Monitoring | Decisions, errors, timeouts and latency monitored | Dashboards and alerts live | Must |
| HK-24 | Run | Escalation | Repeated denials escalate to a person | Escalation after configured count | Should |
| HK-25 | Run | Integrity | Hook configuration integrity monitored | Unexpected change raises an alert | Must |
| HK-26 | Run | Audit | Policy decisions retained with request, decision, policy version and latency | Audit sample complete for sampled runs | Must |
Related plan sections and inventory
- Plan: 4B Hooks and lifecycle extension points · 4B Tools · 10 Security for agentic systems · 10B Authorization with Cedar policy grants · 14 Human-in-the-loop · 14A Autonomous bounded operation
- Inventory: Guardrails and runtime security (examples: NeMo Guardrails, Guardrails AI, LlamaFirewall, Invariant Guardrails, Model Armor, Amazon Bedrock Guardrails, Prompt Shields) · Agent frameworks and orchestration (examples: Claude Agent SDK, OpenAI Agents SDK, LangChain and LangGraph, Google ADK, Microsoft Agent Framework, Pydantic AI, Strands Agents)
- Related guides: Guardrails · Tool design and MCP servers · Agent runtime and durable execution · Sandboxing and code execution · Observability and tracing · Prompt assembly and context engineering
Governing policies and procedures
From the CoE policy set (draft; control IDs on the policy crosswalk):
- POL-16 Secure Agent Engineering Policy
- POL-12 Logging, Audit and Provenance Policy
- POL-04 Human Oversight and Escalation Policy
Unverified or needs review
- Timeout behaviour differs between one harness's command hooks (a timed-out PreToolUse hook does not block unless
onFailure: "block") and its SDK callbacks (a timed-out PreToolUse callback means the tool does not run) [1][2]. Re-test on the pinned version before relying on either. - The OpenAI Agents SDK lifecycle hooks are documented as observe-only; the page does not state that they cannot block, it simply documents no blocking mechanism [5].
- Compaction and error events for OpenAI Agents SDK, Google ADK and Microsoft Agent Framework are marked "n/a in opened docs"; they may exist in pages not opened.
- Latency figures in Sizing are illustrative, not measured.
- Policy timeout, repeated-denial count and hook output size defaults are practitioner defaults for the CoE to confirm.
- One harness's docs call hooks "best-effort filters" and recommend the permission system for hard allow or deny [1]; the plan's statement that "hooks are where deterministic policy lives" should be read as hooks being the enforcement point that calls policy, with hard rules also in permissions. Plan 4B wording needs review.
- The Kiro hooks reference was checked only for triggers, actions and the 60-second command timeout [12].
Sources
- Hooks reference, Claude Code documentation, Anthropic, https://code.claude.com/docs/en/hooks, accessed 30 Nov 2026.
- Intercept and control agent behavior with hooks, Claude Agent SDK documentation, Anthropic, https://code.claude.com/docs/en/agent-sdk/hooks.md, accessed 30 Nov 2026.
- Manage Claude's memory (instruction files), Claude Code documentation, Anthropic, https://code.claude.com/docs/en/memory, accessed 30 Nov 2026.
- Guardrails, OpenAI Agents SDK documentation, https://openai.github.io/openai-agents-python/guardrails/, accessed 30 Nov 2026.
- Lifecycle reference, OpenAI Agents SDK documentation, https://openai.github.io/openai-agents-python/ref/lifecycle/, accessed 30 Nov 2026.
- Human-in-the-loop, OpenAI Agents SDK documentation, https://openai.github.io/openai-agents-python/human_in_the_loop/, accessed 30 Nov 2026.
- Custom middleware, LangChain documentation, https://docs.langchain.com/oss/python/langchain/middleware/custom, accessed 30 Nov 2026.
- Built-in middleware, LangChain documentation, https://docs.langchain.com/oss/python/langchain/middleware/built-in, accessed 30 Nov 2026.
- Plugins, Google Agent Development Kit documentation, https://adk.dev/plugins/, accessed 30 Nov 2026.
- Callbacks, Google Agent Development Kit documentation, https://adk.dev/callbacks/, accessed 30 Nov 2026.
- Agent middleware, Microsoft Agent Framework documentation, Microsoft Learn, https://learn.microsoft.com/en-us/agent-framework/agents/middleware/, accessed 30 Nov 2026.
- Hooks, Kiro documentation, https://kiro.dev/docs/hooks/, accessed 30 Nov 2026.
- Agent instruction bloat (Technology Radar Vol. 35, Caution), Thoughtworks (4 Nov 2026), https://www.thoughtworks.com/radar/techniques/agent-instruction-bloat, accessed 30 Nov 2026.
- OWASP Top 10 for Agentic Applications, OWASP GenAI Security Project (9 Dec 2025), https://genai.owasp.org/2025/12/09/owasp-top-10-for-agentic-applications-the-benchmark-for-agentic-security-in-the-age-of-autonomous-ai/, accessed 30 Nov 2026.
- Memory Is a Feature. It Is Also an Attack Surface, OWASP GenAI Security Project blog (13 May 2026), https://genai.owasp.org/2026/05/13/memory-is-a-feature-it-is-also-an-attack-surface/, accessed 30 Nov 2026.
- Practical security guidance for sandboxing agentic workflows and managing execution risk, NVIDIA Technical Blog (30 Jan 2026, updated 5 Mar 2026), https://developer.nvidia.com/blog/practical-security-guidance-for-sandboxing-agentic-workflows-and-managing-execution-risk, accessed 30 Nov 2026.