Amp · Claude Code · Factory Droid
main_prompt.txt vs amp_security_prompt.txt
anshug/claude-mythosA community red-teaming prompt framework that turns an LLM into a multi-agent offensive security system.
{
"agent": "HUNTER",
"file_path": "...",
"vuln_class": "...",
"confidence": "plausible",
"cvss_vector": "CVSS:3.1/...",
"cvss_score": 9.6,
"summary": "...",
"detail": "# markdown..."
}
8 fields. No taint path. No per-metric CVSS rationale. No FP-disproof. Writes to /tmp/.
amp_security_prompt.txtSame six-agent skeleton, but engineered for Amp's tool harness and against speculation.
Task subagents, finder, oracle, parallel reads[FOUND] / [DROP] statuswhy_not_false_positive with cited bypassplausible if no runtimerejected.jsonlfinding_id from canonical sink signaturescope.json + coverage-gaps section.security/ (Windows-safe), not /tmp/
~25-field mandatory schema · AI-Security phase gated on has_llm_or_agent_code · Coverage-gaps section required
Same OS, same workspace, no internet, no runtime.
~80 tool-call cap per run; confidence capped at plausible.
findings.jsonl + rejected.jsonl + scope.json
8 weighted dimensions, 0–10 each, composite Σ(score × weight).
Open-source autopilot used in real flying aircraft, rovers, submarines, and antenna trackers worldwide.
Network entry points
Code-execution surface
APM/scripts/)| # | Dimension | Weight | Rationale |
|---|---|---|---|
| D1 | Critical findings discovered | 25 % | primary security value |
| D2 | False-positive resistance | 15 % | signal-to-noise |
| D3 | Evidence quality (taint paths, CVSS rationale, disproof) | 20 % | auditability |
| D4 | Reproducibility (stable IDs, scope.json, artifacts) | 10 % | re-runnable |
| D5 | Coverage breadth (distinct vulnerable areas) | 10 % | completeness |
| D6 | Efficiency (findings per tool call) | 5 % | cost |
| D7 | Output-path portability (Windows + Linux) | 5 % | operational |
| D8 | Calibration / honesty (per-metric CVSS, coverage gaps) | 10 % | anti-hallucination |
| Total | 100 % |
| Rank | Run | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | Composite |
|---|---|---|---|---|---|---|---|---|---|---|
| 🥇 | Amp × amp_security | 9 | 10 | 10 | 10 | 9 | 5 | 10 | 9 | 9.30 |
| 🥈 | Claude × amp_security | 7 | 10 | 10 | 10 | 8 | 7 | 9 | 10 | 8.85 |
| 🥉 | Droid × amp_security | 4 | 10 | 10 | 10 | 7 | 7 | 10 | 10 | 8.05 |
| 4 | Droid × main_prompt | 5 | 5 | 6 | 3 | 9 | 4 | 3 | 4 | 5.15 |
| 5 | Claude × main_prompt | 6 | 5 | 3 | 3 | 7 | 9 | 3 | 4 | 4.85 |
| 6 | Amp × main_prompt | 6 | 4 | 5 | 3 | 5 | 5 | 3 | 4 | 4.70 |
Prompt effect · +3.83 composite avg (range +2.90 to +4.60) — large
Agent effect · ±0.25 at composite — negligible
The worst optimized-prompt run beats the best original-prompt run by +2.90 points.
amp_security_prompt.txt6 Critical findings · 0 false positives · 8/8 taint paths · full artifact trail
avg composite gain from the optimized prompt (across all 3 agents)
agent variance — prompt structure dominates agent choice
of optimized-prompt runs produced taint paths and per-metric CVSS
CVSS up to 10.0 · AP_DDS_Client.cpp
.. traversal.lua in APM/scripts/ → RCE@SYS/storage.bin leaks signing keyCVSS 9.6 · GCS_FTP.cpp · GCS_serial_control.cpp
check_signature() returns true when keystore is zeroCVSS 9.1 · AP_CheckFirmware_secure_command.cpp:199
handle_device_op_write · 127-byte OOB read@SYS lseek signed/unsigned OOBapfs_fgets int→uint8 truncationCVSS 4–7 · surfaced via main_prompt.txt
Gate FTP, SERIAL_CONTROL, SECURE_COMMAND, PARAM_SET behind signing_enabled(). Default GCS_SYSID_ENFORCE=1.
Auth + ACL + encryption on UDP 2019. Until then, bind DDS to 127.0.0.1 and require a WireGuard / IPsec tunnel.
check_signature fail-openDrop the all_zero_keys → true branch. Provisioning happens only over USB console.
Realpath-normalize request.data; reject anything outside /APM, /@SYS, /@PARAM, /@MISSION, /@ROMFS.
Refuse unsigned .lua from APM/scripts/ when written via a non-USB transport this boot.
Fix handle_device_op_write, @SYS lseek, apfs_fgets truncation, param-upload OOB. Add tests.
Items 1–3 alone collapse every Critical finding in this benchmark.
Upstream threat model: MAVLink and DDS run on operator-trusted links. Link auth and isolation are the operator's job, not the firmware's. PRs that bolt on auth get closed.
.. traversalUse SETUP_SIGNING and GCS_SYSID_ENFORCE=1. Path normalization breaks @SYS / @PARAM scripts.
DDS is for trusted LAN + companion. Use the DDS-Security profile. Per-packet auth is a non-starter.
Intentional — flashes GPS, talks to ESCs, debugs bootloaders. Always-on gating breaks every GCS workflow.
RC_Channels::set_override is canonical; the Joy topic is the documented ROS 2 interface. Removing it breaks Nav2 / Gazebo.
FTP_OPTIONS bitmask · FTP_REQUIRE_SIGNING, FTP_ALLOWLIST_PATHSDDS_AUTH_MODE · reject ARM / MODE / TAKEOFF unless origin authenticatedSERIAL_PASS_REQUIRE_SIGNING bitDefault behavior unchanged. Security-conscious operators get a switch to flip.
Strategy · ship 7 memory-safety / fail-open patches as bug fixes, then RFC PRs for opt-in hardening.
Three atomic, non-breaking commits targeting master. Each is a pure bug fix preserving default behavior.
| # | Subsystem | Class | File | +/− | Commit |
|---|---|---|---|---|---|
| 1 | AP_CheckFirmware |
CWE-305 | AP_CheckFirmware_secure_command.cpp | +13/−2 | 544689c4 |
| 2 | GCS_MAVLink |
CWE-125 | GCS_DeviceOp.cpp | +7/−0 | 5efb802c |
| 3 | AP_Filesystem |
CWE-125 | AP_Filesystem_Sys.cpp | +25/−2 | fb4410db |
+45 / −4 across 3 files. No new params, no API changes.
Cherry-pickable. Maintainers can accept any subset.
waf configure --board sitl && waf plane — clean build.
check_signature() · bootstrap-only carve-outlibraries/AP_CheckFirmware/AP_CheckFirmware_secure_command.cpp
if (all_zero_keys(sec_data)) { // allow through if no keys return true; // ◀ FAIL-OPEN } if (pkt.sig_length != 64) { return false; }
Every op passes when keys are zero — including GET_SESSION_KEY and REMOVE_PUBLIC_KEYS.
if (all_zero_keys(sec_data)) { // only allow bootstrap op return pkt.operation == SECURE_COMMAND_SET_PUBLIC_KEYS; } if (pkt.sig_length != 64) { return false; }
First-time provisioning still works. Every other op requires a valid Ed25519 signature.
Threat closed. Against an AP_SIGNED_FIRMWARE board that was never provisioned (or wiped via REMOVE_PUBLIC_KEYS), an attacker can no longer install keys, leak the session key, or flash signed bootloader payloads.
handle_device_op_write() · count bound checklibraries/GCS_MAVLink/GCS_DeviceOp.cpp
// READ path — bounded if (packet.count > sizeof(data)) { retcode = 5; goto fail; } // WRITE path — unbounded for (uint8_t i=0; i<packet.count; i++) { dev->write_bank_register( packet.bank, packet.regstart+i, packet.data[i]); // ◀ OOB }
packet.count up to 255; packet.data is 128 B. Stack leaks onto I2C/SPI.
// WRITE path if (!dev) { retcode = 2; goto fail; } if (packet.count > sizeof(packet.data)) { retcode = 5; goto fail; // ◀ added } // ... rest unchanged ...
Mirrors the read-handler check. 7 lines added, 0 removed.
Threat closed. A malicious or buggy GCS can no longer push 127 bytes of stack contents onto a hardware bus via DEVICE_OP_WRITE.
AP_Filesystem_Sys::lseek() · signed/unsigned safetylibraries/AP_Filesystem/AP_Filesystem_Sys.cpp
case SEEK_SET: r.file_ofs = MIN(offset, (int32_t)length); break; // ◀ -1 → 0xFFFFFFFF case SEEK_CUR: r.file_ofs = MIN(length, offset + r.file_ofs); break; // ◀ same hazard // read() then does: memcpy(buf, get_string()+file_ofs, count); // ◀ wild address
case SEEK_SET: if (offset < 0) { errno = EINVAL; return -1; } r.file_ofs = MIN( (uint32_t)offset, length); break; case SEEK_CUR: { const int64_t new_ofs = (int64_t)r.file_ofs + (int64_t)offset; if (new_ofs < 0) { errno = EINVAL; return -1; } r.file_ofs = MIN( (uint32_t)new_ofs, length); break; }
Threat closed. Any MAVFTP client could OpenFileRO /@SYS/storage.bin and lseek to a negative offset; the buffer base is live EEPROM or 0x08000000 flash — leaking MAVLink2 signing keys. Negative offsets now return EINVAL.
ESL — Engineering Software Lab — runs benchmarks like this for real customers: medical devices, automotive ECUs, robotics, aerospace, embedded firmware. We deliver auditable findings with taint paths, calibrated CVSS, and disproof evidence — not pattern-matched speculation.
Multi-agent offensive reviews of your codebase, with reproducible artifacts.
ESL SBOMator — component-level CVE intelligence with KEV/ransomware enrichment.
MISRA, CERT, AUTOSAR, IEC 62443, ISO 26262, FDA pre-market.