CCAR-F - Agentic Architecture & Orchestration - Section 1.5

Apply Agent SDK hooks for tool call interception and data normalisation.

PostToolUse hooks intercept tool results for transformation before the model sees them, and outgoing tool calls can be intercepted to enforce compliance rules. Candidates should normalise heterogeneous formats from different MCP tools (Unix timestamps, ISO 8601, numeric status codes), block policy-violating actions such as refunds above a threshold and redirect them to human escalation, and choose hooks over prompt wording whenever a business rule requires a guaranteed outcome.

PostToolUse hooktool call interceptiondata normalisation across MCP toolsdeterministic guarantee versus probabilistic compliancepolicy threshold enforcement

Practice question for this objective

Free sampleAgentic Architecture & Orchestrationmedium

A consumer business allows its Customer Support Resolution Agent to issue refunds up to 500 on its own, and up to 900 when the customer's account is more than 12 months old. The rule is written in the system prompt and repeated in the project CLAUDE.md. A quarterly audit of 5,000 sessions finds 14 refunds between 500 and 900 paid on accounts younger than 12 months, and compliance requires that count to reach zero. Which change most effectively meets that requirement?

  • ASet the maximum on the amount field in the process_refund input schema to 500, so that any larger value fails validation before the tool is invoked and the agent has to hand the case to a human instead.
  • BAdd a PreToolUse hook on process_refund that reads the requested amount and the account age already retrieved in the session, and blocks the call when the amount is above 500 on an account younger than 12 months. Correct
  • CRestate the two thresholds at the top of the system prompt with the amounts in bold, repeat them in the project CLAUDE.md beside the refund guidance, and re-run the audit at the end of the next quarter.
  • DRoute every refund request through a separate classifier subagent that predicts whether the requested amount is permitted for that account and returns an approval flag the main agent is instructed to respect.
Enforce a conditional policy threshold in a PreToolUse hook when compliance requires a deterministic guarantee rather than probabilistic adherence. A compliance target stated as zero cannot be met by anything the model decides, because prompt guidance and predicted approval flags both leave a residual failure rate. A PreToolUse hook runs as code between the model's decision and the tool's execution, so it can read the amount and the account age together and refuse the call, which a static schema maximum cannot do because the permitted ceiling varies by account.

Why A is wrong: Tempting because schema validation is genuinely deterministic and would stop every breach. It also blocks the permitted 900 refunds on established accounts, since a static field maximum cannot express a limit that varies with account age, so it buys compliance by breaking a sanctioned path.

Why B is correct: Correct because the hook evaluates the two-part condition in code before the refund is submitted, so a call that breaches the policy cannot execute whatever the model concluded, which is what a compliance figure stated as zero requires.

Why C is wrong: Tempting because the instruction is already close to correct and clearer wording usually improves adherence. Prompt guidance yields probabilistic compliance, so it lowers the breach count without driving it to zero, and the audit surfaces that a quarter later.

Why D is wrong: Tempting because a second opinion sounds like a control. The check is a simple comparison of an amount against an account age, so a predicted flag adds latency and cost while swapping one probabilistic judgement for another rather than enforcing the limit.

See more CCAR-F practice questions, answers explained.

More in this domain

Back to all Agentic Architecture & Orchestration objectives, or the CCAR-F cert hub.

Examworthy is not affiliated with or endorsed by Anthropic. Original, blueprint-aligned practice material only.