Agent SDK for TypeScript 0.3.328 lets a failed hook block the action it guards

Versions 0.3.328 and 0.3.329, both 19 November 2026, add a block-on-failure option for MCP tool hooks and a warning when managed hooks do not load. Teams that embed the SDK should check.

what changed

Two releases of the Agent SDK for TypeScript shipped on 19 November 2026.

Version 0.3.328 adds onFailure to mcp_tool hooks in the Settings type. With "block", a hook whose call fails blocks the action it guards. It also adds the CLAUDE_CODE_DISABLE_DEFERRED_TOOL_RESUME variable, which stops resume and continue from running a tool call that a hook deferred. An inline agent in agents now overrides a same-named user, project, plugin or built-in agent. Also in this release, when a PermissionRequest hook rewrites a shell command, the rewrite’s own permission check decides the sandbox, so a sandbox-excluded rewrite runs outside it.

Version 0.3.329 adds a managed_hooks_not_loaded warning when hooks in managed settings fail to load. It adds permissions.workingDirectoriesExclude, which marks paths as outside the working directory. It also releases large idle tool-result data after 30 seconds. A Keychain save failure now reports invalid_request with a null api_error_status, not 401.

why it matters

Hooks are where many teams put their safety checks. Until now a hook that errored could leave the guarded action free to run. The new option closes that gap for MCP tool hooks. The hook-rewrite change matters too: it changes where a rewritten command may run.

If your code reads the error from a failed login, the change from a 401 to a null status can break your handling.

what we would do

  • Set onFailure to "block" on every mcp_tool hook that guards a risky action, then test that a broken hook stops the action.
  • Read the sandbox change again if you rewrite shell commands in a PermissionRequest hook. Test that the rewrite still runs where you expect.
  • Watch for the managed_hooks_not_loaded warning in your logs and alert on it.
  • Check any code that branches on the old login error values before you upgrade.

sources

Drafted with Claude from the linked sources, reviewed by us.