git, Python 3.11+, the requests and jsonschema packages, an API key for the security model you pick, a test copy of the repository, and about 2 GB of free disk for reports and a sandbox checkout.git apply and passes your tests.
uname -a (Linux/macOS) or wsl --status (Windows).git --version must print something like git version 2.43.0.python3 --version must print Python 3.11.x or higher.<carbon-model-id>, <carbon-endpoint> placeholders until confirmed.df -h . shows the Avail column.What to do: pin the exact code snapshot, limit the audit scope, and write down which model you will use for which stage.
mkdir -p audit/{reports,prompts,patches}
git clone https://github.com/<your-org>/<your-repo>.git audit-target
cd audit-target
git rev-parse HEAD | tee ../audit/commit.txt
find . -name '*.py' -not -path './.venv/*' | wc -l
Example: git rev-parse HEAD prints 9f2c1ab4e77d1b0f3a5c8d21f0b6e4c9a1d7f203. The find | wc -l command prints 143, the number of Python files available — that is your scoping budget, so pick modules (auth, sessions, payments) rather than the whole tree.
Why: a model finding is only reproducible against a fixed commit. Without commit.txt you cannot tell whether a patch failed because the model was wrong or because the code moved.
How to check: cat ../audit/commit.txt must print a 40-character SHA, and git status must show a clean working tree. If git status lists modified files, stop — you are not auditing a known snapshot.
Model comparison, using only what the source post states:
| Model | Difference (per the source post) | Price |
|---|---|---|
| Gemini 4 Carbon | Single-profile security model: finds a vulnerability, confirms it is actually exploitable, and writes the patch. The source reports it leads in three checks — vulnerability detection, exploitability confirmation and code repair. Not distributed through open retail channels. | Not published in the source — confirm on the vendor pricing page |
| GPT-6 Astra | No security-audit data in the source. Positioned for work, chat and API use in our Astra/Sol comparison; treat it as a general-purpose reviewer until vendor security benchmarks are confirmed. | Not published in the source — confirm on the vendor pricing page |
Decision rule: if your deliverable is “confirmed finding + patch”, start with Carbon for the find-and-confirm stages because that is the only capability the source actually documents for it. Use Astra as a second reviewer when your team already standardizes on it, and treat its output as a lead, not a verdict. Background on assistant families and their coding roles: AI for programmers: coding assistants in 2026.
How to check: write the scope to a file and count it — ls src/auth src/sessions > ../audit/scope.txt && wc -l ../audit/scope.txt prints e.g. 2. Two entries means the scope is fixed and small enough for a first pass.

What to do: create a strict output schema, then run the model three times per finding — detection, exploitability confirmation, patch generation.
export SECURITY_MODEL_ENDPOINT='<carbon-endpoint>'
export SECURITY_MODEL_ID='<carbon-model-id>'
export SECURITY_MODEL_KEY='<api-key>'
python3 -m venv .venv && source .venv/bin/activate
pip install requests jsonschema
python -c "import os; print(os.environ['SECURITY_MODEL_ID'], os.environ['SECURITY_MODEL_ENDPOINT'])"
Example: the last command prints <carbon-model-id> <carbon-endpoint>. If either is empty, your shell session lost the export and every call will fail later with a 404 or 401 — fix it now, not after a 40-minute run.
Schema file audit/prompts/find.json:
{
"type": "object",
"required": ["findings"],
"properties": {
"findings": {
"type": "array",
"items": {
"type": "object",
"required": ["id", "file", "line", "cwe", "severity", "evidence", "confidence"],
"properties": {
"id": {"type": "string"},
"file": {"type": "string"},
"line": {"type": "integer"},
"cwe": {"type": "string"},
"severity": {"enum": ["low", "medium", "high", "critical"]},
"evidence": {"type": "string"},
"confidence": {"type": "number"}
}
}
}
}
}
Runner audit/run_audit.py (the request body below uses the common chat-completions shape — confirm the exact field names in your vendor’s API reference before the first run):
import json, os, pathlib, requests
ENDPOINT = os.environ["SECURITY_MODEL_ENDPOINT"]
MODEL = os.environ["SECURITY_MODEL_ID"]
KEY = os.environ["SECURITY_MODEL_KEY"]
def ask(prompt: str) -> dict:
r = requests.post(
ENDPOINT,
headers={"Authorization": f"Bearer {KEY}", "Content-Type": "application/json"},
json={"model": MODEL,
"messages": [{"role": "user", "content": prompt}],
"response_format": {"type": "json_object"}},
timeout=180,
)
r.raise_for_status()
return json.loads(r.json()["choices"][0]["message"]["content"])
if __name__ == "__main__":
src = pathlib.Path(os.environ["TARGET_FILE"]).read_text()
stage = os.environ["STAGE"] # find | confirm | patch
schema = json.loads(pathlib.Path(f"audit/prompts/{stage}.json").read_text())
prompt = (f"Stage: {stage}. Commit: {os.environ['AUDIT_COMMIT']}. "
f"Return JSON only, matching this schema: {json.dumps(schema)}. "
f"For stage 'confirm' every finding needs a concrete request path and preconditions, "
f"or the verdict 'not reproducible'. For stage 'patch' return a unified diff only.\n\n{src}")
print(json.dumps(ask(prompt)))
Run stage one across the scope:
export AUDIT_COMMIT=$(cat audit/commit.txt)
for f in src/auth/*.py; do
TARGET_FILE="$f" STAGE=find python audit/run_audit.py >> audit/reports/find.jsonl
done
Why it works: the schema is sent inside the prompt and enforced by response_format, so the model cannot answer in prose; every finding arrives with a file, line and CWE (Common Weakness Enumeration — the standard bug-class ID, e.g. CWE-89 for SQL injection), which is what makes triage mechanical instead of a reading exercise.
How to check: python -c "import json;[json.loads(l) for l in open('audit/reports/find.jsonl')];print('ok')" prints ok. Then pick the confirmed findings only — anything without a “not reproducible” verdict must be reproduced in Step 3 before it goes into the report.

What to do: reproduce each finding against a local sandbox, apply only patches that pass git apply --check, and re-run tests.
git checkout -b audit/fix-$(date +%F)
git apply --3way --check audit/patches/F-001.diff && git apply --3way audit/patches/F-001.diff
python -m pytest -q tests/
Example: before the patch, record the baseline response of the PoC request, for example curl -s -o /dev/null -w '%{http_code}\n' "http://127.0.0.1:8080<path-from-poc>" returning 302. After the patch the same request must return the safe status your test asserts (for example 400). If it still returns 302, the patch did not fix the bug even though it compiled.
Why: the source credits Carbon with confirming exploitability, but a model’s “exploitable” claim is a hypothesis; the sandbox run is the evidence. git apply --check fails before touching your tree, so a bad diff costs you nothing.
How to check: python -m pytest -q tests/ must end with a line like 12 passed in 4.31s and exit code 0 (echo $? prints 0). Then finish the report checklist:
audit/commit.txt exists and matches git rev-parse HEAD at audit timenot reproduciblegit apply --3way --checkpytest green on the patch branchaudit/reports/ archived next to the commit SHAProblem. The runner stops on the first call with a 404.
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: <carbon-endpoint>python -c "import os;print(os.environ['SECURITY_MODEL_ID'], os.environ['SECURITY_MODEL_ENDPOINT'])". Request access for the account if the model is absent from that list.Problem. The model answers in prose and parsing fails.
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)response_format was dropped, the prompt did not repeat the schema, or a very large file was truncated mid-answer.response_format in the request, keep the schema text inside the prompt, and split the file per function before sending. Validate with python -c "import json,jsonschema;jsonschema.validate(json.load(open('audit/reports/one.json')), json.load(open('audit/prompts/find.json')));print('valid')" — it must print valid.Problem. The generated patch does not apply.
error: patch failed: src/auth/session.py:42 followed by error: src/auth/session.py: patch does not applygit stash && git checkout $(cat audit/commit.txt), re-run the patch stage, then test with git apply --3way --check audit/patches/F-001.diff before applying.You now have a pinned commit, a schema-validated findings report, reproduced PoCs and a patch that passes git apply --check and your test suite. Next, run the same three stages with GPT-6 Astra as a second reviewer on the same commit and diff the finding lists — the disagreements are your real triage queue.
Can Gemini 4 Carbon replace a human security reviewer?
No. The source describes a model that finds, confirms and patches, but accountability, threat modelling and release sign-off stay with your team; the model’s claims become evidence only after you reproduce them.
Is there published benchmark data comparing Carbon and GPT-6 Astra on security?
The source reports Carbon leading in three checks — detection, exploitability confirmation and code repair — but publishes no scores, and gives no security-audit figures for Astra. Ask both vendors for the benchmark report and cite it with a date.
How much do these models cost?
The source publishes no prices, and Carbon is not sold through open retail channels, so per-account commercial terms apply. Check the vendor pricing page or ask your account manager before quoting any number internally.
Can I send an entire private repository to the model?
Only if your contract and data-retention terms allow it. Run on a sanitized test copy, strip secrets first (gitleaks detect --source . or your standard scanner), and confirm retention rules in vendor documentation; for a wider tool landscape see ChatGPT, Claude, Gemini, DeepSeek: AI assistant comparison.