Put a passport in front of agent actions.
Start with GitHub Repository Guard for a no-secret repository checkpoint, then add runtime hooks where your agents run. APort creates or selects a passport, checks actions before execution where the surface supports it, and records decisions for audit.
Public setup paths
Copy the command for the repository or runtime you use today.
command-first
run this in your repo
GitHub Repository Guard
Create the Repository Guard workflow from the public APort Action. Default auto mode uses GitHub OIDC, creates or reuses a repository-scoped hosted passport, and starts with report-only evidence.
npx @aporthq/aport-agent-guardrails githubruntime hook
Claude Code
Run the installer on the machine where Claude Code runs. It creates or selects a hosted OAP passport, writes the PreToolUse hook, and starts logging allow/deny decisions.
npx @aporthq/aport-agent-guardrails claude-coderuntime hook
Cursor
Run the installer on the workstation that runs Cursor. It writes the hook config for shell, file, and MCP tool checks; hosted mode does not require a local passport JSON file.
npx @aporthq/aport-agent-guardrails cursortool authorization
MCP tools
Authorize MCP tool calls through supported framework hooks or a direct verify API call using the mcp.tool.execute.v1 policy pack.
npx @aporthq/aport-agent-guardrails claude-code
# Configure allowed MCP servers/tools in the passportIT-managed rollout only
Enterprise device deployment
Use this for managed fleets, not individual public quickstarts. IT sets the template passport, framework, and API key once, then reuses the same device passport on reinstall.
Deployment guideexport APORT_API_KEY="apk_..."
export APORT_TEMPLATE_ID="ap_..."
export APORT_FRAMEWORK="claude-code"
curl -fsSL "https://api.aport.io/enterprise/scripts/deploy" | sudo -E bashDetailed guides
Configure the path that matches your rollout.
These guides expand the commands above with dashboard, API, and repository configuration details.
Protect Pull Requests from Agentic Changes
Add a GitHub Action that evaluates repository changes against APort policies before merge. Start with report-only findings, then enable hosted mode for signed OAP decisions and branch-protection blocking.
Start here
Add Repository Guard with one command.
Run this from the repository root. It creates .github/workflows/aport-guard.yml using the published aporthq/policy-verify-action@v1 path in mode: auto.
npx @aporthq/aport-agent-guardrails githubManual fallback
Paste the workflow YAML if your org blocks download commands.
This is the same public setup path as the command above: GitHub OIDC, repository-scoped hosted passport issue/reuse, and mode: auto. Use it when you need to review or create CI files by hand.
# .github/workflows/aport-guard.yml
name: APort Repository Guard
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled, review_requested, review_request_removed]
pull_request_review:
types: [submitted, dismissed]
push:
branches:
- main
merge_group:
permissions:
id-token: write
contents: read
pull-requests: read
jobs:
aport:
name: APort / OAP code.repository.merge.v1
if: >-
github.event_name != 'pull_request_review' ||
github.event.action == 'dismissed' ||
github.event.review.state != 'commented'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: aporthq/policy-verify-action@v1
with:
mode: autoRepository Checkpoint
Verify PRs and protected pushes
OAP Policy Decision
Report findings or enforce signed decisions
Clear Feedback
Show developers the exact finding
Configurable Evidence
Add protected paths and repo rules
Share the guard
Add the APort badge after the workflow is passing.
The Action summary includes this snippet automatically. The badge is visibility; branch protection or rulesets are what make it enforceable.
[](https://github.com/OWNER/REPO/actions/workflows/aport-guard.yml)Review and Commit the Guard
Run the command-first setup from the root of your repository, then review and commit the generated workflow
npx @aporthq/aport-agent-guardrails github
# Review and commit the generated workflow.
git diff -- .github/workflows/aport-guard.yml
git add .github/workflows/aport-guard.yml
git commit -m "Add APort Repository Guard"
git pushExpected Result
Repository Guard configured - PRs and protected pushes generate findings, the job summary includes a README badge, and hosted enforcement can generate blocking APort decisions
Dashboard Alternative
Start free with auto mode. Upgrade to Team when you want hosted enforcement and org audit.
Use GitHub OIDC
The generated workflow uses the published APort GitHub Action in auto mode. GitHub OIDC issues or reuses a repository-scoped OAP passport without APort API keys in workflow secrets
# No APORT_AGENT_ID or APORT_API_KEY secret is required for mode: auto.
# The Action requests a GitHub OIDC token and APort binds the hosted passport to:
# - repository / repository_id
# - event type and runner evidence
permissions:
id-token: write
contents: read
pull-requests: readExpected Result
OIDC configured - no broad APort API key stored in GitHub secrets
Dashboard Alternative
OIDC creates or reuses a repository-scoped hosted passport without adding an APort API key to secrets.
Use Your Hosted Passport
For enterprise audit, store the repository passport ID as a GitHub variable and the APort API key as a secret. APort still requires GitHub OIDC before it signs and persists the decision.
# Store the passport ID as a GitHub Actions variable.
gh variable set APORT_GITHUB_AGENT_ID --body "ap_your_repo_passport_id"
# Store the APort API key as a GitHub Actions secret.
gh secret set APORT_API_KEY
# Then use managed hosted mode in .github/workflows/aport-guard.yml:
- uses: aporthq/policy-verify-action@v1
with:
mode: hosted
agent-id: ${{ vars.APORT_GITHUB_AGENT_ID }}
api-key: ${{ secrets.APORT_API_KEY }}
# The API key is sent as X-API-Key only to APort Verify.
# GitHub OIDC still proves the workflow is running for the bound repository.
# External fork PRs are detected by the Action and continue through
# the no-secret hosted OIDC path because GitHub withholds secrets there.Expected Result
Managed hosted audit - decisions persist under your APort org passport
Dashboard Alternative
Use this after creating a GitHub-bound passport in APort for the repository.
Test a Known Denial
Switch the Action to hosted mode, then create a test PR that changes workflow permissions to see a high-confidence denial.
# First enable blocking hosted enforcement in .github/workflows/aport-guard.yml:
# - uses: aporthq/policy-verify-action@v1
# with:
# mode: hosted
#
# Then create a test PR that should be denied in hosted enforcement.
# 1. Create a branch with a workflow permission escalation
git checkout -b test-policy-violation
mkdir -p .github/workflows
cat > .github/workflows/aport-policy-test.yml <<'YAML'
name: APort policy violation test
on: pull_request
permissions: write-all
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: echo "this workflow requests broad repository permissions"
YAML
git add .github/workflows/aport-policy-test.yml
git commit -m "Add workflow permission escalation"
git push origin test-policy-violation
# 2. Create PR via GitHub CLI
gh pr create --title "Test: Policy violation" --body "Testing APort policy enforcement"
# Expected result in hosted mode with branch protection:
# the PR check fails with a reason like:
# "❌ APort Verification Failed
# Reason: OAP.REPO.WORKFLOW_PERMISSION_ESCALATION
# Workflow write permissions were introduced or expanded."
#
# In mode: auto, use the same PR as a report-only smoke test; do not expect
# branch protection to block unless hosted enforcement is enabled.
# 3. Check the workflow logs for detailed policy context
# Go to Actions tab > APort Repository Guard > View logsExpected Result
Repository Guard test - clear denial or report-only finding
Dashboard Alternative
See Limits, Paths, and other policy settings in your Agent Passport
Add Repository Policy Evidence
Optionally add repository-local evidence for protected paths and pinned actions
# .aport/policy.yaml
version: oap-github-policy/1
repository:
protected_paths:
- .github/workflows/**
- package.json
- pnpm-lock.yaml
- functions/api/verify/**
- policies/**
github:
require_pinned_actions: trueExpected Result
Repository evidence configured - APort evaluates protected-path and action-pinning findings
Dashboard Alternative
Move from report-only to blocking when your Team or Enterprise org is ready for branch protection.