Skip to content

docs(tools): add action-bound governance example - #1571

Open
jw-ond wants to merge 1 commit into
i-am-bee:mainfrom
jw-ond:codex/action-bound-governance-tool-example
Open

docs(tools): add action-bound governance example#1571
jw-ond wants to merge 1 commit into
i-am-bee:mainfrom
jw-ond:codex/action-bound-governance-tool-example

Conversation

@jw-ond

@jw-ond jw-ond commented Jul 24, 2026

Copy link
Copy Markdown

Summary

Adds a Python tools example showing how to bind a tool-side governance checkpoint to a canonical action hash before performing an external side effect.

The example is intentionally vendor-neutral and runs with an in-process checkpoint so it can be read and executed without any external service. A production deployment could replace the local checkpoint with an HTTP service that returns the same kind of decision object.

What it demonstrates

  • Building a canonical action envelope from the proposed tool action
  • Hashing that envelope before execution
  • Calling a checkpoint before the side effect is performed
  • Failing closed if the checkpoint decision is not bound to the same action hash
  • Returning structured outcomes for approve, require_approval, and reject

Verification

PYTHONPATH=python /tmp/beeai-action-bound-venv/bin/python -m py_compile python/examples/tools/action_bound_governance.py
/tmp/beeai-action-bound-venv/bin/ruff check python/examples/tools/action_bound_governance.py python/examples/README.md
/tmp/beeai-action-bound-venv/bin/ruff format --check python/examples/tools/action_bound_governance.py
PYTHONPATH=python /tmp/beeai-action-bound-venv/bin/python python/examples/tools/action_bound_governance.py

The example prints one completed action, one approval-required action, and one rejected action.

Signed-off-by: jw_ond <THU-Tokyo@outlook.com>
@jw-ond
jw-ond requested a review from a team as a code owner July 24, 2026 14:10
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 24, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation python Python related functionality labels Jul 24, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

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

Labels

documentation Improvements or additions to documentation python Python related functionality size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant