You set a limit in one file.
ghost.yml holds the percentage you allow and what happens over it. Ghost reads it from your main branch, so a pull request cannot loosen its own rule.
GitHookforOriginSourceTracking
Know which lines in a pull request were written by AI, and decide how much is okay.
You set the limit in a small config file. Contributors install Ghost once and keep using their usual agents. Ghost writes the record into the commit itself, and CI checks the lines that would actually merge.
curl -sSL https://raw.githubusercontent.com/farhankhan197/ghost/main/install.sh | bashGhost repository policy initialized
policy: ghost.yml
enforcement: scope=final_diff history=warn
binaries: ghost (single binary)
owner policy will be read from the base branch during PR checks
How it works
Contributors work as usual. Each pull request shows how much of it came from an agent, measured on the lines that survived to review.
ghost.yml holds the percentage you allow and what happens over it. Ghost reads it from your main branch, so a pull request cannot loosen its own rule.
When a contributor works with Codex, Claude, Cursor, or another supported agent, Ghost saves which lines came from that session on their machine.
Ghost looks at the final diff in the pull request. Earlier drafts stay in the history for context but do not block a clean result.
Attribution travels in Git notes next to the code, so you can check months later which lines came from an agent session.
A short config
This example allows up to 80 percent AI lines in the final diff and blocks the merge above that. History stays visible for review but does not block on its own.
threshold: 80% required: false on_exceed: block enforcement: scope: final_diff history: warn
ghost verify-pr origin/main..HEAD --base origin/mainFor maintainers
Contributors keep their setup. You get a number on each pull request and a record you can check later.