Skip to content

APort Policy Verification Action v1.0.0

Choose a tag to compare

@uchibeke uchibeke released this 24 Sep 06:28
· 23 commits to main since this release
41fbffb

APort Policy Verification Action v1.0.0

πŸ›‘οΈ Secure Your Repositories with AI Agent Verification

We're excited to announce the first public release of the APort Policy Verification GitHub Action! This powerful security tool ensures only authorized AI agents and bots can make changes to your repositories, providing enterprise-grade protection for your development workflows.


✨ What's New in v1.0.0

πŸ”’ Core Security Features

  • Policy Enforcement - Verify pull requests against APort agent policies
  • GitHub Integration - Seamless integration with GitHub Actions workflows
  • Context Mapping - Automatic mapping of GitHub context to APort policies
  • Flexible Configuration - Customizable policy packs and enforcement rules
  • PR Comments - Automatic PR comments with detailed policy results
  • Multiple Triggers - Support for various GitHub events and manual dispatch

🎯 Advanced Capabilities

  • Repository Safety (repo.v1) - Comprehensive repository-level safety policies
  • Actor Validation - Verify GitHub actors and apps are authorized
  • Size Limits - Prevent oversized PRs and file uploads
  • Review Requirements - Enforce code review policies
  • Path Allowlists - Restrict file access patterns
  • Branch Protection - Control which branches can receive PRs

οΏ½οΏ½ Key Features Overview

Feature Description Impact
πŸ›‘οΈ Policy Enforcement Verify PRs against APort agent policies High Security
πŸ”„ GitHub Integration Seamless workflow integration Easy Adoption
πŸ“ PR Comments Automatic policy result reporting Clear Feedback
βš™οΈ Flexible Config Customizable policy packs Enterprise Ready
πŸ” Context Mapping Auto-maps GitHub context to policies Smart Automation

οΏ½οΏ½ Quick Start

1. Basic Setup (30 seconds)

name: APort Policy Check
on: [pull_request]

jobs:
  policy-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: aporthq/policy-verify-action@v1
        with:
          agent-id: ${{ secrets.APORT_AGENT_ID }}

2. Advanced Configuration

name: Advanced APort Policy Check
on:
  pull_request:
    types: [opened, synchronize, labeled, ready_for_review]
  workflow_dispatch:
    inputs:
      agent_id:
        description: 'Agent ID to verify'
        required: true

jobs:
  policy-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: APort Policy Verification
        uses: aporthq/policy-verify-action@v1
        with:
          agent-id: ${{ github.event.inputs.agent_id || secrets.APORT_AGENT_ID }}
          policy-pack: ['repo.v1'](https://aport.io/policy-packs/repo.v1/)
          api-base: 'https://api.aport.io'
          fail-on-violation: true
          comment-on-pr: true

πŸ”§ Configuration Options

Input Parameters

Parameter Description Required Default
agent-id APort Agent ID for verification βœ… -
policy-pack Policy pack to enforce ❌ repo.v1
api-base APort API base URL ❌ https://api.aport.io
fail-on-violation Fail workflow on policy violation ❌ true
comment-on-pr Add PR comment with results ❌ true

Output Values

Output Description
allowed Boolean indicating if action is allowed
reasons JSON array of policy violation reasons

πŸ“ˆ Policy Packs

repo.v1 - Repository Safety

Enforces comprehensive repository-level safety policies:

Required Capabilities:

  • repo.pr.create - Create pull requests
  • repo.merge - Merge pull requests

Required Limits:

  • max_prs_per_day - Daily PR creation limit
  • max_merges_per_day - Daily merge limit
  • max_pr_size_kb - Maximum PR size in KB

Enforcement Rules:

  • Repository Allowlist - Restrict which repositories the agent can act on
  • Base Branch Allowlist - Control which branches can receive PRs
  • Path Allowlist - Restrict file access patterns
  • Size Limits - Prevent oversized PRs and file uploads
  • Review Requirements - Enforce code review policies
  • GitHub Actor Validation - Verify the GitHub actor is authorized
  • GitHub App Validation - Verify the GitHub app is authorized

Minimum Assurance Level: L2 (Level 2)


πŸ” Context Mapping

The action automatically maps GitHub context to APort policy context:

GitHub Context APort Context Description
github.repository repo Repository name
github.event.pull_request.base.ref base_branch Target branch
github.actor github_actor GitHub actor
github.app github_app GitHub app
Computed diff stats files_changed, lines_added Change statistics
PR size calculation pr_size_kb PR size in KB for size limits
Changed file paths file_paths File paths for path allowlist enforcement
Review requirements requires_review Whether review is required
PR labels labels Pull request labels
Review count reviews Number of reviews
Draft status is_draft Whether PR is draft
Mergeable status is_mergeable Whether PR can be merged

πŸ—οΈ Setup Guide

1. Create APort Agent

  1. Go to APort Dashboard
  2. Create a new agent
  3. Configure policy settings
  4. Note the Agent ID

2. Set GitHub Secrets

Add the following secrets to your repository:

# Required
APORT_AGENT_ID=your-agent-id-here

# Optional (for PR comments)
GITHUB_TOKEN=your-github-token

3. Configure Agent Passport (NOT TESTED)

In your APort agent passport, set up the following:

{
  "integrations": {
    "github": {
      "allowed_actors": ["your-bot[bot]", "acme-ci"],
      "allowed_apps": ["your-github-app"]
    }
  },
  "capabilities": ["repo.v1"],
  "assurance_level": 3
}


🚨 Troubleshooting

Common Issues

  1. Agent not found

    • Verify APORT_AGENT_ID is correct
    • Check agent exists in APort dashboard
  2. Policy violations

    • Review agent passport configuration
    • Check policy pack requirements
    • Verify GitHub actor/app permissions
  3. API errors

    • Verify api-base URL is correct
    • Check network connectivity
    • Review API rate limits

Debug Mode

Enable debug logging:

- name: APort Policy Verification
  uses: aporthq/policy-verify-action@v1
  with:
    agent-id: ${{ secrets.APORT_AGENT_ID }}
    debug: true

πŸ“š Examples & Documentation

Complete Examples

Documentation


🀝 Community & Support

Get Help

Contribute

  • Fork the repository
  • Create a feature branch
  • Make your changes
  • Submit a pull request

What's Next

Upcoming Features (v1.1.0)

  • Custom Policy Packs - Create your own policy configurations
  • Enhanced Logging - More detailed debug information
  • Performance Metrics - Track action execution times
  • Multi-Agent Support - Verify multiple agents in one workflow

Future Roadmap

  • Enterprise Features - Advanced compliance reporting
  • Integration Hub - Connect with more CI/CD tools
  • Policy Templates - Pre-built policy configurations
  • Analytics Dashboard - Usage and compliance insights

* License & Legal**


Thank You

Thank you to all the contributors, testers, and early adopters who helped make this release possible! Your feedback and support have been invaluable in creating a robust and secure solution for AI agent verification.

Ready to secure your repositories? Get started now! πŸš€


*For more information, visit aport.io *