Skip to content

feat(governance): cross-organizational federation governance model (#93) #33

feat(governance): cross-organizational federation governance model (#93)

feat(governance): cross-organizational federation governance model (#93) #33

Workflow file for this run

# AI-powered deep code review for the agent-governance-toolkit.
# Analyzes PR diffs for security issues, policy engine correctness,
# trust/identity flaws, sandbox escape vectors, and API compatibility.
# Uses GitHub Models API (gpt-4o) via the ai-agent-runner composite action.
# Fork PRs are supported via pull_request_target with explicit HEAD SHA checkout.
name: AI Code Review
on:
pull_request_target:
types: [opened, synchronize, reopened]
branches: [main]
permissions:
contents: read
pull-requests: write
models: read
jobs:
ai-review:
name: Deep AI Code Review
runs-on: ubuntu-latest
# Skip bots and draft PRs
if: >-
github.event.pull_request.draft == false &&
github.actor != 'dependabot[bot]' &&
github.actor != 'github-actions[bot]'
continue-on-error: true
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# SECURITY: pull_request_target — checkout base branch (default), NOT
# the PR head. The composite action fetches the diff via GitHub API,
# so checking out HEAD is unnecessary and would let a malicious PR
# modify .github/actions/ code that runs with elevated GITHUB_TOKEN.
fetch-depth: 0
- name: Run AI code review
id: review
uses: ./.github/actions/ai-agent-runner
with:
agent-type: code-reviewer
github-token: ${{ secrets.GITHUB_TOKEN }}
model: gpt-4o
fallback-model: gpt-4o-mini
max-tokens: "4000"
context-mode: pr-diff
output-mode: pr-review
custom-instructions: |
You are reviewing the microsoft/agent-governance-toolkit — a security-focused Python library.
Stack: Python 3.9-3.12, monorepo with 8 packages under packages/, pytest, ruff.
Focus areas:
- Policy engine correctness (false negatives = security bypass)
- Trust/identity: cryptographic operations, credential handling, SPIFFE/SVID
- Sandbox escape vectors
- Thread safety in concurrent agent execution
- OWASP Agentic Top 10 compliance
- Type safety and Pydantic model validation
- Backward compatibility (public API changes)
Provide actionable feedback. Flag security issues as 🔴 CRITICAL.
Flag potential breaking changes as 🟡 WARNING.
Suggest improvements as 💡 SUGGESTION.