Skip to content

Instantly share code, notes, and snippets.

@ruvnet
Created June 14, 2026 21:12
Show Gist options
  • Select an option

  • Save ruvnet/a77366913e70fe65d9cffa12d59f8ef9 to your computer and use it in GitHub Desktop.

Select an option

Save ruvnet/a77366913e70fe65d9cffa12d59f8ef9 to your computer and use it in GitHub Desktop.
MetaHarness × GitHub Actions: a one-command non-interactive CI/CD agent harness — .github/workflows + composite action, default-deny via permissions (ADR-033). npx @metaharness/github-actions@latest my-bot

MetaHarness × GitHub Actions

A one-command scaffold for a non-interactive AI agent harness that runs on the GitHub Actions runner — the 9th MetaHarness host (ADR-033) and the only one built for CI/CD.

Intro

Every other MetaHarness host is interactive: a human starts a session and watches the agent work. GitHub Actions is different in kind. There's no human at the keyboard — execution is triggered by a webhook (a push, a pull request, an issue comment, or a schedule), the "operator" is the runner, and the harness must complete its task autonomously, emit structured output, and exit cleanly.

@metaharness/github-actions is a thin wrapper around the metaharness CLI. Running it is equivalent to npx metaharness my-bot --template minimal --host github-actions.

Usage details

npx @metaharness/github-actions@latest my-bot
cd my-bot
git add .github && git commit -m "add harness workflow" && git push

Then add your model-provider key as a repository secret (Settings → Secrets and variables → Actions → ANTHROPIC_API_KEY) and trigger it from the Actions tab, or by commenting on an issue.

Features

The scaffold drops into .github/:

  • .github/workflows/<name>.yml — the trigger workflow. Safe defaults: workflow_dispatch + issue_comment. push, pull_request, and schedule are included but commented out — uncomment to enable.
  • .github/actions/<name>/action.yml — a reusable composite action the workflow calls, so the harness logic works across multiple workflows.
  • install.md — the wiring + permissions runbook.
  • .claude-plugin/plugin.json — the same folder also loads as a Claude Code plugin via claude -p --plugin-dir.

Advanced

Default-deny → least-privilege token (ADR-022). The workflow's permissions: block starts at contents: read and grants only what the harness policy's allow-list implies:

allow token GitHub scope
create-pr, push-branch contents: write, pull-requests: write
label, triage issues: write
checks, status checks: write

Anything unmapped stays denied. For production-touching jobs, gate behind a GitHub Environment with required reviewers — the token scope alone does not add human review.

Validate the scaffold like any other harness:

npx harness doctor      # workflow + action YAML parse
npx harness validate    # full umbrella gate
npx harness mcp-scan    # flag over-broad permission grants

Source + all 19 example packages: https://github.com/ruvnet/agent-harness-generator/tree/main/examples-packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment