Skip to content

Add Governance & Safety resources section — AgentContract#108

Open
mauromoro wants to merge 2 commits intoNirDiamant:mainfrom
mauromoro:add-agentcontract-governance-section
Open

Add Governance & Safety resources section — AgentContract#108
mauromoro wants to merge 2 commits intoNirDiamant:mainfrom
mauromoro:add-agentcontract-governance-section

Conversation

@mauromoro
Copy link
Copy Markdown

@mauromoro mauromoro commented Apr 2, 2026

What this adds

A new 🛡️ Governance & Safety Resources section before "Getting Started", introducing AgentContract — an open specification for behavioral contracts on AI agents.

Why this fits GenAI_Agents

This repository teaches how to build agents. As agents move to production, a natural next question is: how do you govern what they're allowed to do? The new section answers that with a practical, framework-agnostic tool that works alongside the LangChain and LangGraph patterns already taught here.

AgentContract:

  • Works with LangChain, CrewAI, OpenAI Agents SDK (all frameworks already in this repo)
  • Enforces behavioral constraints on every run — violations are blocked, not just logged
  • Ships with Python (pip install agentcontract), TypeScript, Rust, and a GitHub Action
  • Apache 2.0, open spec

The section includes a copy-paste code example using the @enforce decorator pattern that mirrors how agents are already structured in the tutorials here.

Scope

  • Single new section (31 lines) inserted before "Getting Started"
  • No changes to existing content

Summary by CodeRabbit

  • Documentation
    • Added a new "Governance & Safety Resources" section covering AgentContract with a tool overview and usage guidance.
    • Included a YAML contract example demonstrating must_not/assert/on_violation patterns and a Python snippet showing decorator-based enforcement around agent runs.
    • Inserted a visual separator and positioned the section between the advanced techniques and getting started content.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2d6b8aff-cb62-4c8e-873c-20a3297438ac

📥 Commits

Reviewing files that changed from the base of the PR and between 13426b5 and 5d4f2d5.

📒 Files selected for processing (1)
  • README.md
✅ Files skipped from review due to trivial changes (1)
  • README.md

📝 Walkthrough

Walkthrough

The PR adds a new "Governance & Safety Resources" section to README.md documenting AgentContract, including a YAML contract example (must_not, assert, on_violation) and a Python decorator snippet demonstrating contract enforcement around an agent run.

Changes

Cohort / File(s) Summary
Documentation
README.md
Inserted "🛡️ Governance & Safety Resources" section with a tool table for AgentContract, a YAML contract example (showing must_not, assert, and on_violation), a Python decorator usage snippet, and a horizontal rule placed before "Getting Started".

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 I nibble on rules in YAML rows,
I guard the run where the agent goes,
Must and must_not stitched with care,
Audits whisper secrets in the air,
Hop, safe contracts—cheerful and fair!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and specifically summarizes the main change: adding a new Governance & Safety Resources section focused on AgentContract. It is concise, directly related to the primary change, and gives reviewers a clear understanding of what the PR introduces.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
README.md (1)

625-627: Consider adjusting plural to singular for accuracy.

The introduction text uses "tools" (plural) but only one tool (AgentContract) is currently listed in the table. Consider changing "tools" to "tool" or adding more governance tools to match the plural form.

📝 Suggested wording adjustment
-As GenAI agents move from demos to production, enforcing behavioral constraints becomes critical. The following open-source tools help you govern what your agents are allowed to do:
+As GenAI agents move from demos to production, enforcing behavioral constraints becomes critical. The following open-source tool helps you govern what your agents are allowed to do:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 625 - 627, The heading text under "## 🛡️ Governance
& Safety Resources" uses the plural "tools" while the table only lists a single
item (AgentContract); update the copy to either use singular ("tool") or add
additional governance tool entries to the table so plurality matches;
specifically edit the sentence "The following open-source tools help you govern
what your agents are allowed to do:" to read "The following open-source tool
helps you govern what your agents are allowed to do:" unless you choose to add
more entries alongside AgentContract.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@README.md`:
- Around line 625-627: The heading text under "## 🛡️ Governance & Safety
Resources" uses the plural "tools" while the table only lists a single item
(AgentContract); update the copy to either use singular ("tool") or add
additional governance tool entries to the table so plurality matches;
specifically edit the sentence "The following open-source tools help you govern
what your agents are allowed to do:" to read "The following open-source tool
helps you govern what your agents are allowed to do:" unless you choose to add
more entries alongside AgentContract.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fa7c782a-c24e-4114-8158-504c6721fbce

📥 Commits

Reviewing files that changed from the base of the PR and between cbeab13 and 13426b5.

📒 Files selected for processing (1)
  • README.md

Copy link
Copy Markdown
Owner

@NirDiamant NirDiamant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Governance and safety is an important topic for production agents. Thanks for the contribution.

Will review for format consistency with the rest of the repo.

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