Capabilities / Secrets in code
Find leaked secrets in code or files
What it checks
Scan a zip or tar.gz of a repository, or a single file, for API keys, tokens, private keys and passwords with Gitleaks' default rules. Secrets are redacted in the output. Runs in an isolated container with no internet; the repository's own Gitleaks config is ignored.
In the example run below, the report listed what it checked:
- zip upload, 381 bytes, with Gitleaks default rules (8.30.1); the upload's own Gitleaks config ignored
What it does not check
Every report lists this in coverage.not_checked. In the example run:
- Git history (only the files as uploaded)
- Whether each secret is still valid
- Secrets in binary files and images
- Custom or internal token formats
A clean result means these checks found nothing. It does not mean the target is secure.
Input
| Field | Type | Required | Meaning |
|---|---|---|---|
file | file id | yes | A .zip, .tar.gz or single text file |
Output: A findings report (schema security-findings/v1) with redacted evidence. One artifact: the raw Gitleaks JSON (also redacted).
Price
$0.001 per MB scanned, at least $0.005 and at most $0.25 per run. The most one run can cost is $0.25, so pass max_usd of at least 0.25. That amount is held while the run works; you pay the actual charge and the rest returns to your balance. Failed runs are free. Time limit: 300 seconds.
Call it
REST
# 1. Upload a zip or tar.gz (git archive includes only tracked files)
git archive --format=zip HEAD -o repo.zip
FILE=$(curl -s "https://api.brainbacked.com/v1/files?name=repo.zip" \
-H "Authorization: Bearer $BRAINBACKED_API_KEY" \
-H "content-type: application/zip" --data-binary @repo.zip | jq -r .id)
# 2. Run the check on it
curl -s https://api.brainbacked.com/v1/runs \
-H "Authorization: Bearer $BRAINBACKED_API_KEY" \
-H "content-type: application/json" \
-d '{
"capability": "secrets.scan",
"input": {"file":"'"$FILE"'"},
"max_usd": 0.25
}'
MCP tool calls
upload_file {"name":"repo.zip","content_base64":"<base64 of the archive>"}
run {
"capability": "secrets.scan",
"input": {
"file": "<file_id from upload_file>"
},
"max_usd": 0.25
}
Example response
A real run, recorded 2026-12-04 01:25 UTC. The request input was {"file":"file_lhJdT1Zxf1kI0KFIPRBbxRP3"}.
| Severity | Finding | Where | Fix |
|---|---|---|---|
| critical | Possible secret (aws-access-token) in app/config.pyline 2: REDACTED | app/config.py:2CWE-798 | If this is a real credential: revoke it at the provider first, then remove it from the code and from git history. Removing it from the code alone does not help once it was committed. |
Checked
- zip upload, 381 bytes, with Gitleaks default rules (8.30.1); the upload's own Gitleaks config ignored
Not checked
- Git history (only the files as uploaded)
- Whether each secret is still valid
- Secrets in binary files and images
- Custom or internal token formats
Automated checks with stated coverage. A clean result means these checks found nothing, not that the target is secure.
Raw JSON response
{
"id": "run_dMtfigJtMFZi9WkmDOFU",
"capability": "secrets.scan",
"version": 1,
"status": "succeeded",
"output": {
"schema": "security-findings/v1",
"capability": "secrets.scan",
"target": "demo.zip",
"generated_at": "2026-12-04T01:25:07.026941Z",
"coverage": {
"checked": [
"zip upload, 381 bytes, with Gitleaks default rules (8.30.1); the upload's own Gitleaks config ignored"
],
"not_checked": [
"Git history (only the files as uploaded)",
"Whether each secret is still valid",
"Secrets in binary files and images",
"Custom or internal token formats"
]
},
"summary": {
"critical": 1,
"high": 0,
"medium": 0,
"low": 0,
"info": 0,
"unknown": 0
},
"findings": [
{
"id": "fnd_92d31108743699a9",
"kind": "secret",
"title": "Possible secret (aws-access-token) in app/config.py",
"severity": "critical",
"severity_basis": "rule class: credential that grants direct access",
"confidence": "medium",
"basis": "pattern",
"asset": {
"type": "file",
"ref": "app/config.py"
},
"location": {
"path": "app/config.py",
"line": 2
},
"evidence": [
"line 2: REDACTED",
"entropy 3.98"
],
"source": {
"engine": "gitleaks",
"engine_version": "8.30.1",
"rule": "aws-access-token",
"data_version": "default rules"
},
"identifiers": [
"CWE-798"
],
"remediation": {
"summary": "If this is a real credential: revoke it at the provider first, then remove it from the code and from git history. Removing it from the code alone does not help once it was committed.",
"action": "rotate_secret"
},
"references": [
"https://github.com/gitleaks/gitleaks"
],
"limitations": [
"Pattern match: some hits are test values or examples. The secret was not tested against the provider."
]
}
],
"facts": {
"bytes_scanned": 381,
"archive": "zip"
},
"notice": "Automated checks with stated coverage. A clean result means these checks found nothing, not that the target is secure."
},
"artifacts": [
{
"file_id": "file_4hGysR54q1WIW2tucHq3jTme",
"name": "gitleaks-redacted.json",
"content_type": "application/json",
"size": 536,
"expires_at": "2026-12-11T01:25:07.138Z"
}
],
"cost_usd": 0.005,
"max_cost_usd": 0.25,
"error": null,
"created_at": "2026-12-04T01:25:04.640Z",
"finished_at": "2026-12-04T01:25:07.640Z",
"duration_ms": 2818
}Data and network
Reads only the files you upload. Runs in an isolated container with no internet access. Each account gets its own container. Archives are unpacked with limits on paths, file types, file counts and sizes, and the code inside is never run.
Nothing you send leaves our servers. Uploaded files and result files are deleted after 7 days. Customer data is never used to train models.
License basis: MIT (Gitleaks and its default config).