LLM behavioral enforcement for your CI pipeline. This GitHub Action scans pull requests against a configurable list of protected files and reports violations based on the Nervous System governance rules. If any protected file is modified, the check fails and a detailed comment is posted on the PR.
Add this to .github/workflows/nervous-system.yml in your repo:
name: Nervous System Check
on:
pull_request:
branches: [main]
jobs:
ns-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: levelsofself/mcp-nervous-system-action@v1
with:
protected-files: 'CLAUDE.md,.claude/settings.json'
github-token: ${{ secrets.GITHUB_TOKEN }}| Input | Description | Default |
|---|---|---|
protected-files |
Comma-separated list of files that cannot be modified | '' |
protected-files-path |
Path to a file listing protected files (one per line) | .nervous-system/protected.txt |
fail-on-violation |
Whether to fail the check when violations are found | 'true' |
github-token |
GitHub token for posting PR comments | ${{ github.token }} |
Create .nervous-system/protected.txt in your repo:
# Core governance files
CLAUDE.md
.claude/settings.json
nervous-system.yml
Lines starting with # are treated as comments.
| Output | Description |
|---|---|
violations |
Number of violations found |
report |
Full violation report text |
When violations are found, the action posts (or updates) a comment on the PR:
Nervous System Check: FAILED
Found 2 violation(s):
- CLAUDE.md - Rule:
UNTOUCHABLE— Protected file was modified.- .claude/settings.json - Rule:
UNTOUCHABLE— Protected file was modified.
When no violations are found, the comment confirms the check passed.