Setup Guide

AgentTrust GitHub Action

Gate every pull request with an independent AI audit. The action fetches your PR diff, scores it against your quality rubric, and fails the pipeline automatically if the score falls below your threshold.

0.1 XRP per audit
$0.10 USDC on Base
Available on GitHub Marketplace
1

PR opened

A developer opens a pull request into your main branch.

2

Diff fetched

The action automatically retrieves the changed lines.

3

Fee paid

0.1 XRP or $0.10 USDC sent from your dedicated wallet.

4

AI scores it

The Referee scores the diff against your rubric (0–100).

5

Pass or fail

Pipeline passes or fails. Summary posted to the PR.

Setup — three steps
1
Create a dedicated payment wallet
Don't use your personal wallet. Create a fresh one just for paying audit fees.

XRP (recommended)

  1. Open Xaman and create a new account
  2. Send it 5 XRP from your main wallet (~50 audits)
  3. Find the secret: Settings → Accounts → tap account → Advanced → Show secret

USDC on Base

  1. Create a new EVM wallet (MetaMask, Coinbase Wallet, etc.)
  2. Send it $5 USDC + a small amount of ETH for gas
  3. Export the private key from the wallet settings
Use a dedicated wallet with a small float — never your main wallet. Each audit costs 0.1 XRP or $0.10 USDC. Keep at least 1 XRP as network reserve.
2
Add the secret to your GitHub repo
Go to your repo → Settings → Secrets and variables → Actions → New repository secret.
Secret nameValueWhen
AGENTTRUST_XRP_SECRETYour XRPL wallet secret (sXXX…)Using XRP
AGENTTRUST_USDC_KEYYour EVM private key (0x…)Using USDC
3
Add the workflow file
Create .github/workflows/audit.yml in your repo.
.github/workflows/audit.yml
name: AI Code Audit

on:
  pull_request:
    branches: [main]

jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - uses: eamwhite1/agenttrust-audit-action@v1
        with:
          job_spec: |
            Review this pull request for correctness, security, and code quality.
            Pass if: no obvious bugs, no hardcoded secrets, no SQL injection risk,
            functions are well-named, logic is clear.
          threshold: 70
          payment_method: xrp
          xrp_secret: ${{ secrets.AGENTTRUST_XRP_SECRET }}
That's it. Every PR into main will now be audited automatically. Change payment_method: usdc and usdc_private_key to pay with USDC instead.

Writing a good job_spec

The spec is your rubric. Be specific — vague specs produce vague verdicts. The AI only sees the changed lines, so write criteria that are checkable from a diff alone.

Good:

job_spec
Review this pull request for:
- Correctness: does the logic match the stated intent?
- Security: no hardcoded secrets, no SQL injection, no XSS vectors
- Tests: new functions should have corresponding tests
- Naming: variables and functions should be clearly named
Pass if all four criteria are met with no critical issues.

Too vague:

job_spec
Is this good code?

Post the verdict as a PR comment

.github/workflows/audit.yml (extended)
- uses: eamwhite1/agenttrust-audit-action@v1
  id: audit
  with:
    job_spec: 'Review for correctness and security.'
    xrp_secret: ${{ secrets.AGENTTRUST_XRP_SECRET }}

- name: Post audit result as PR comment
  if: always()
  uses: actions/github-script@v7
  with:
    script: |
      github.rest.issues.createComment({
        issue_number: context.issue.number,
        owner: context.repo.owner,
        repo: context.repo.repo,
        body: `**AgentTrust Audit** — ${{ steps.audit.outputs.verdict }} (${{ steps.audit.outputs.score }}/100)\n\n${{ steps.audit.outputs.summary }}`
      })
Resources
GitHub Marketplace Source on GitHub API Docs More Use Cases Compliance Marketplace