APort Quickstart

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

IT-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 guide
managed rollout script
export 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 bash

Detailed guides

Configure the path that matches your rollout.

These guides expand the commands above with dashboard, API, and repository configuration details.

GitHub Repository Guard

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.

repository setup command
npx @aporthq/aport-agent-guardrails github

Manual 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
# .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: auto

Repository 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.

README.md badge
[![APort Repository Guard](https://github.com/OWNER/REPO/actions/workflows/aport-guard.yml/badge.svg)](https://github.com/OWNER/REPO/actions/workflows/aport-guard.yml)
1

Review and Commit the Guard

Run the command-first setup from the root of your repository, then review and commit the generated workflow

Code Example
step-1
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 push

Expected 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.

See GitHub Guard
2

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

Code Example
step-2
# 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: read

Expected 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.

Read Setup Docs
3

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.

Code Example
step-3
# 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.

Open Pricing
4

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.

Code Example
step-4
# 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 logs

Expected Result

Repository Guard test - clear denial or report-only finding

Dashboard Alternative

See Limits, Paths, and other policy settings in your Agent Passport

Review Policy Packs
5

Add Repository Policy Evidence

Optionally add repository-local evidence for protected paths and pinned actions

Code Example
step-5
# .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: true

Expected 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.

See Pricing