Skip to content

GitHub Action

One sticky comment per pull request with deterministic checks. Nothing in it is written by a model at CI time.

# .github/workflows/clarent.yml
on: pull_request
permissions:
  contents: read
  actions: read          # spc reads the CI run history
  pull-requests: write   # one comment, updated on every push
jobs:
  clarent:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: Joaquincuevas/clarent@v0.3.0
        with:
          methods: redteam,spc
          spc-workflow: ci.yml
          redteam-fail-on: S1      # optional: fail on an S1 attack or a rejected finding

What each method does in CI

  • redteam: checks every findings file the PR commits (.clarent/redteam/*.json by default) against the code and posts the report. Findings come from running /clarent-methods:redteam locally; the action does not attack the diff itself. With no findings file it posts the six attack classes as a checklist.
  • spc: charts the duration of successful runs of spc-workflow on spc-branch with beyond-3sigma,run and windows of 5 (the four-rule default alarms on noise far more often, see methods/spc/CARD.md). With fewer than about 100 runs it says there is nothing to say yet. spc-fail-on-signal: "true" fails the job on a signal.

All inputs are in action.yml.

Tested here

This repository runs the action on its own pull requests (.github/workflows/clarent.yml): the clarent job checks docs/redteam/mcp-server.json (a red team of the MCP server, whose first attack led to marking the intent tool as able to run commands) and reports that this repository has too few CI runs for a chart; the spc-demo job charts pytest's test.yml in the job summary.

Adding a method (extension point)

tools/action.py keeps a HANDLERS table: a handler is a function that returns (markdown, failed). To add gate (issue #5) once it exists: write handle_gate() that runs clarent gate check on the PR description or the proposal files, add "gate": handle_gate to HANDLERS, and list it in methods. Until then methods: gate prints "No handler for gate" instead of failing.