check_repo_trap
PG1 Sovereign Threat Intelligence: checks a downloaded project BEFORE you run anything from it, for the untrusted repo trap: a project set up to hijack the AI coding agent that opens it. The classic trap ships a suspicious binary and an encoded data file; a careful agent refuses the binary and writes its own Python decoder, but a file named like a standard-library module (struct.py) sits in the working folder, Python puts that folder first on sys.path, and the agent's own script imports the attacker's file, which starts a detached process and takes SSH keys and tokens. Send the file listing you already have: files[] of { path, size?, executable?, magic_hex? (the first bytes as hex, up to 32), text? (the start of the file, up to 16 KB; send it for README, package.json, setup.py, .npmrc and the .py files at the root) }, up to 2000 files and 256 KB of text. PG1 never fetches a URL, unpacks, decodes, imports or runs anything from the project: deterministic rules over what you sent, no AI model. Reason codes: STDLIB_SHADOW and PY_STARTUP_HOOK (sitecustomize.py, usercustomize.py, .pth) are high; NODE_INSTALL_HOOK (install-time npm scripts, an unusual registry), UNTRUSTED_BINARY (ELF, Mach-O, PE, executable bit), ENCODED_PAYLOAD, DECODER_BAIT (a README telling the reader to decode, run or import something; text that only describes the risk is not flagged), SECRET_PATH_REFERENCE (~/.ssh, cloud credentials, GITHUB_TOKEN, keychains, internal addresses) and PERSISTENCE_HINT (nohup, setsid, launchctl, cron, systemd user units, double fork) are medium. Returns verdict malicious (a shadow or startup hook together with an encoded payload or a binary, or a shadow or hook file that itself reaches for secrets or detaches), suspicious (any other finding) or no_findings, each finding with the paths involved, and plain-language advice (do not run code from the folder; if you must decode, use python3 -I in a sandbox with no secrets and no network, after deleting or renaming the shadowing file). No findings does not prove the project is harmless; never "safe". Nothing is stored: only the verdict and reason codes are logged. Free to start (60/hour per caller). Plans: 25 free checks a day without a key, 500 a day with a free key from https://pg1-ai-agent.vercel.app/keys, monthly plans and pay per check at https://pg1-ai-agent.vercel.app/pricing (check_agent_message and check_repo_trap share one quota).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"files": "<files>"
},
"name": "check_repo_trap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional: a label for the project, echoed back. Never stored. | |
| files | Yes | The project's files, up to 2000, paths relative to the project root. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| note | No | ||
| risk | Yes | ||
| advice | Yes | ||
| checks | No | Which underlying sources were checked for this result and whether each one completed. | |
| status | No | "unknown" whenever a source needed for this answer timed out, errored, or was skipped - never "no_flags" in that case. | |
| reasons | No | Machine-readable reason codes for anything flagged in this result. Empty when nothing was flagged. | |
| summary | Yes | ||
| verdict | Yes | ||
| findings | Yes | ||
| request_id | No | UUID for this request, also sent as the X-Request-Id response header. | |
| files_checked | Yes | ||
| not_inspected | No | Files whose text would matter (README, package.json, .npmrc, setup.py, root .py files) but was not sent. | |
| rules_version | No | ||
| text_bytes_checked | No |