Skip to content

Warn and fail closed for sync ToolNode enforcement#49

Open
Muhammad-usman92 wants to merge 1 commit into
secureagentics:mainfrom
Muhammad-usman92:fail-closed-sync-toolnode
Open

Warn and fail closed for sync ToolNode enforcement#49
Muhammad-usman92 wants to merge 1 commit into
secureagentics:mainfrom
Muhammad-usman92:fail-closed-sync-toolnode

Conversation

@Muhammad-usman92

@Muhammad-usman92 Muhammad-usman92 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Warn during adrian.init() when WebSocket enforcement is enabled without a running event loop.
  • Fail closed in sync ToolNode.invoke when policy state is not ready yet, or when BLOCK/HITL mode is active but no resolved verdict is available.
  • Reuse existing blocked ToolMessage behaviour: [BLOCKED by security policy].
  • Keep async ToolNode.ainvoke behaviour unchanged.

Test plan

  • Added SDK regression coverage for sync ToolNode.invoke fail-closed enforcement.
  • Added SDK coverage for the init warning when no running event loop exists.
  • Ran focused SDK tests: 21 passed.
  • Ran ruff on changed SDK files.

Checklist

  • CLA signed (see CLA.md)
  • Tests pass locally
  • Docs updated where needed
  • British English; no em-dashes; no marketing fluff

@yanny-sec

Copy link
Copy Markdown
Contributor

Sorry to keep you waiting on this PR and thank you for your contribution! Could you rebase onto current main and solve the conflicts?

@Muhammad-usman92

Copy link
Copy Markdown
Contributor Author

Sorry to keep you waiting on this PR and thank you for your contribution! Could you rebase onto current main and solve the conflicts?

Absolutely! I'll rebase the PR onto the latest main branch and resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants