feat(agents-sdk): add govern() fail-closed governance interceptor hel… - #3473
Open
Adityakk9031 wants to merge 1 commit into
Open
feat(agents-sdk): add govern() fail-closed governance interceptor hel…#3473Adityakk9031 wants to merge 1 commit into
Adityakk9031 wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: f5f5c3f The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Adityakk9031
requested a deployment
to
inkeep-oss-sync
July 21, 2026 18:17 — with
GitHub Actions
Waiting
Contributor
|
Thanks for the contribution! What happens next:
|
Author
|
@robert-inkeep and @tim-inkeep have a look |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #3463 by introducing
govern(), an interceptor-based governance helper in@inkeep/agents-sdkdesigned to mitigate CWE-636 (fail-open observer pattern flaw).Context
Standard observer-pattern event hooks in LLM agent frameworks fail-open if a governance hook or policy check crashes, allowing tool execution to proceed without policy approval. This PR introduces a fail-closed interceptor execution boundary following the CCS (Correctover Conformance Standard) specification.
Key Changes
Governance Interceptor Helper (
govern())govern(handler, options)inpackages/agents-sdk/src/governance.ts.false, the underlying tool execution handler is never called (fail-closed contract).onDenyhooks and custom error messages.Public SDK Exports
governandGovernanceOptionsinpackages/agents-sdk/src/index.ts.Unit Tests & Changeset
packages/agents-sdk/src/__tests__/governance.test.ts..changeset/add-govern-interceptor.md.Usage Example
Verification
onDenyhandlers.@inkeep/agents-sdk.