AI code security review: an adversarial diff-audit engine and an agent-driven whole-repo review methodology, with security knowledge as rich rules
Project description
██████╗ ██████╗ ██████╗ ███████╗ ██╗██╗ ██╗██████╗ ██╗ ██╗
██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██║██║ ██║██╔══██╗╚██╗ ██╔╝
██║ ██║ ██║██║ ██║█████╗ ██║██║ ██║██████╔╝ ╚████╔╝
██║ ██║ ██║██║ ██║██╔══╝ ██ ██║██║ ██║██╔══██╗ ╚██╔╝
╚██████╗╚██████╔╝██████╔╝███████╗╚█████╔╝╚██████╔╝██║ ██║ ██║
╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
AI code security review for diffs and whole repositories.
It runs two paths matched to their nature.
- Diff Review is coded. It audits a pull request diff for newly introduced exploitable risk, as a single balanced LLM call or an adversarial Finder, Challenger, and Judge pass that trades roughly 3x the cost for extra recall on subtle flaws that span files.
- Repo Review is agent driven. It is a methodology an interactive agent such as Claude Code or Codex runs to map a codebase attack surface, trace inputs to sinks across files, verify issues with a real PoC, and iterate over rounds with a persistent memory. A whole repository is too large for one LLM call, so it ships the methodology and scaffolds the workspace instead of running a pipeline.
Security knowledge lives in rich vulnerability classes under codejury/data/vulnerabilities/*.md, with a
vulnerable and a secure example per language, injected into the audit prompt
rather than buried in code.
Install
pip install codejury # core
pip install "codejury[anthropic]" # add a backend, also openai or litellm
Diff Review
# audit a diff file
codejury review diff --diff-file changes.diff
# audit a git range in a repo
codejury review diff --repo /path/to/app --git-range origin/main...HEAD
# from stdin
git diff HEAD~1 | codejury review diff
# adversarial mode, more recall on subtle flaws, about 3x the cost
codejury review diff --diff-file changes.diff --mode adversarial
# CI gate and SARIF
codejury review diff --diff-file changes.diff --format sarif --fail-on high
Configure a backend with --provider, --model, --api-key, --api-base, or
the CODEJURY_API_KEY, CODEJURY_MODEL, and CODEJURY_API_BASE environment
variables. codejury review diff --dry-run exercises the engine with a mock
provider and no key, and falls back to a built in demo diff when you pass none.
Choosing a Model and Mode
Detection quality is dominated by the model first, then the mode. On real diff probes:
- A strong model at the Claude Sonnet tier in standard mode caught every planted vulnerability with almost no false positives. A weaker model raised false positives in both modes, so the model is the lever that matters most.
- Adversarial mode did not lower false positives over standard on those probes and costs about 3x. Reach for it to gain recall on subtle logic that spans files, not as a way to cut false positives.
Default to standard mode with a strong model, set with --model or
CODEJURY_MODEL. False positives are held down by the do not report list and the
post filter, not by the mode.
Use in CI with GitHub Actions
Audit every pull request and surface findings in the code scanning tab. Copy
examples/codejury-pr-review.yml into .github/workflows/, add a
CODEJURY_API_KEY repository secret, and it will
- diff the pull request against its base with
--git-range origin/<base>...HEAD, - write SARIF and upload it with
github/codeql-action/upload-sarif, - fail the check on a HIGH or CRITICAL finding with
--fail-on high.
The job makes one model call per pull request in standard mode. The SARIF is uploaded even when the gate fails, so findings always show up on the pull request.
Repo Review
codejury review repo /path/to/your/repo
This scaffolds a review workspace with entrypoints/, issues/, analysis/,
and a security-review-memory.md, seeds the entrypoint inventory from a
deterministic scan, and prints the methodology. Run it with an interactive agent.
It reads the methodology and the vulnerability classes, maps the attack surface, traces inputs to
sinks across files, records high confidence issues with a PoC, and asks you to
confirm credentials or false positives along the way. Nothing runs against
production.
Findings
Each finding carries a file and line, a severity and category, a concrete exploit scenario, a recommendation, and a confidence. A false positive filter drops test paths, mock paths, and low confidence noise. The model is also told not to report dependency CVEs, style notes, speculation, or risks that only matter when production config leaks.
Extending
Add a vulnerability class by dropping a new file codejury/data/vulnerabilities/<class>.md
with the standard frontmatter of title, impact, tags, and triggers plus a
vulnerable and a secure example. It is data, no code change needed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codejury-0.19.0.tar.gz.
File metadata
- Download URL: codejury-0.19.0.tar.gz
- Upload date:
- Size: 71.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b35a1ec3ebcd703db71533a0d51bf5975c57a631c759bee76be90d6a245b0eb7
|
|
| MD5 |
8ceb01ccf2b746021d41deceab7c7bd5
|
|
| BLAKE2b-256 |
0ce57d9ade0114226c3b86f98295316ccbf0c35746d5a5884679b363868412de
|
Provenance
The following attestation bundles were made for codejury-0.19.0.tar.gz:
Publisher:
publish.yml on aiseclabs/codejury
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codejury-0.19.0.tar.gz -
Subject digest:
b35a1ec3ebcd703db71533a0d51bf5975c57a631c759bee76be90d6a245b0eb7 - Sigstore transparency entry: 1708516085
- Sigstore integration time:
-
Permalink:
aiseclabs/codejury@744e517d8cb50bd237e889e61b8523851fc39484 -
Branch / Tag:
refs/tags/v0.19.0 - Owner: https://github.com/aiseclabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@744e517d8cb50bd237e889e61b8523851fc39484 -
Trigger Event:
release
-
Statement type:
File details
Details for the file codejury-0.19.0-py3-none-any.whl.
File metadata
- Download URL: codejury-0.19.0-py3-none-any.whl
- Upload date:
- Size: 81.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4795b06e7e8940c510070a62d95298442db9b8442adc21fd4becca462da10567
|
|
| MD5 |
3c33ca5744032279efdb2365c64065f4
|
|
| BLAKE2b-256 |
e1fe536b51210d7beebd8949204b2d9742c3d51c1f833002d8ce78f6dea54947
|
Provenance
The following attestation bundles were made for codejury-0.19.0-py3-none-any.whl:
Publisher:
publish.yml on aiseclabs/codejury
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codejury-0.19.0-py3-none-any.whl -
Subject digest:
4795b06e7e8940c510070a62d95298442db9b8442adc21fd4becca462da10567 - Sigstore transparency entry: 1708516111
- Sigstore integration time:
-
Permalink:
aiseclabs/codejury@744e517d8cb50bd237e889e61b8523851fc39484 -
Branch / Tag:
refs/tags/v0.19.0 - Owner: https://github.com/aiseclabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@744e517d8cb50bd237e889e61b8523851fc39484 -
Trigger Event:
release
-
Statement type: