{"data":{"kind":"file","path":"README.md","version_id":"r7kq6pcvblht50fjhuqi8mc9","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":5247,"modified_at":"2026-07-19T02:26:09.263000","content_hash":"e880cf3b138e6304df5b9a267f1472cd772e75cd7e6c2579af43cd8a0bf69004"},"entries":[],"content":"# muni-bdbv-gp\n\nAgentic antiviral design environment for the [Ebolathon hackathon](https://luma.com/2rbgfn69):\nan LLM agent designs an improved, **purchasable** small-molecule inhibitor of\n**Bundibugyo ebolavirus (BDBV) glycoprotein (GP)-mediated viral entry**, starting\nfrom a known binder.\n\nEach rollout runs in its own **Prime sandbox** (`python:3.11-slim`) provisioned at\nsetup with `muni`, `onepot`, and `rdkit-pypi`. Auth uses **`MUNI_TOKEN` (personal\naccess token)** — no OAuth-refresh sharing, safe for thousands of concurrent\nsandboxes — plus `ONEPOT_API_KEY`, both injected as sandbox secrets. The agent\nself-directs experiments; it never executes free-form code — only the typed\ntools below, which wrap HTTPS calls to the Muni platform and OnePot API.\n\n## Dataset\n\n3 seed tasks (train = eval for hackathon scope), one per known BDBV GP entry inhibitor:\n\n| Seed | Potency | Source |\n|---|---|---|\n| inhibitor 118 | IC50 50 nM | PDB 6HS4 ligand (GON) |\n| toremifene | EC50 162 nM | PDB 5JQ7 |\n| clomiphene | EC50 2.42 µM | literature |\n\nTarget: DFF/inhibitor-binding cavity at the GP1–GP2 interface (PDB **6DZM**).\n\n> **Provenance caveats** (seed labels kept as in code for now): Shaikh et al.\n> 2019 (*J Med Chem*, [PMID 30785281](https://pubmed.ncbi.nlm.nih.gov/30785281/))\n> measures compound **118** at IC50 3.1 µM — the headline 50 nM figure belongs\n> to its chlorinated analog **118a** (PDB 6HRO). All ligand-bound structures\n> (6HS4, 6HRO, 5JQ7) are **Zaire EBOV GP**, not BDBV; transfer to BDBV rests on\n> binding-site conservation (Zhao et al. 2016, *Nature*,\n> [PMID 27362232](https://pubmed.ncbi.nlm.nih.gov/27362232/)). 6DZM itself is a\n> 4.3 Å cryo-EM antibody complex (Murin et al. 2018,\n> [PMID 30184505](https://pubmed.ncbi.nlm.nih.gov/30184505/)).\n\n## Tools (hard cap: 20 calls/rollout)\n\n| Tool | Backend | Notes |\n|---|---|---|\n| `search_analogs` | OnePot similarity search | free, seconds |\n| `check_properties` | RDKit panel + PAINS alerts + rule pass/fail | free, seconds |\n| `dock_molecule` | Rowan docking into the **pinned DFF box** on 6DZM | ~0.04 cr, minutes |\n| `predict_admet` | Rowan ADMET-AI | ~30 s |\n| `predict_affinity` | Boltz-2 affinity vs BDBV GP1+GP2 | slow/expensive |\n| `check_job` | poll long-running dock/affinity jobs | no exec call stays open > ~9 min |\n| `submit_candidate` | terminal submission | ends episode |\n\nThe DFF pocket box is **pinned inside the env** (mapped from PDB 6HS4 inhibitor-118\nand 5JQ7 toremifene onto 6DZM via Kabsch superposition; both ligands agree within\n2.7 Å) — agents cannot dock into arbitrary boxes.\n\n## Reward\n\n`score_candidate` (weight 1.0), computed locally and deterministically:\n\n- **0.35 × drug-likeness rules** — mean of 6 checks with ideal bands\n  (MW ≤ 550/≤ 500, cLogP 1–5/< 4.5, HBD ≤ 5, HBA ≤ 10, TPSA ≤ 140, rotors ≤ 8);\n  **PAINS alert → component halved** (anti-promiscuity)\n- **0.40 × OnePot plausibility** — exact self-hit (similarity ≥ 0.999) = in the\n  OnePot make-on-demand **CORE** library → 0.7 + 0.3 × price factor\n  (≤ $150 → 1.0 … > $1000 → 0.3); near analog → 0.4 × best similarity; none → 0.1\n- **0.25 × binding evidence** — the submitted SMILES was docked in the pinned\n  DFF box. **Only `posebusters_valid` poses count.** Primary term: MM-GBSA\n  (−10 → 0 … −30 → 1.0); fallback: vina (−4 → 0 … −8 → 1.0). Blended 60/40\n  with **ligand efficiency** (|vina|/heavy atoms, bar 0.25; LE < 0.12 caps at 0.1)\n  so adding atoms must pay for itself.\n\nGuards: no `submit_candidate`, invalid SMILES, or resubmitting the seed in any\nform (canonical-SMILES comparison) → 0.0.\n\nDrift-detection metrics (log-only): MW, cLogP, heavy atoms, price, LE, MM-GBSA,\nPAINS flag per rollout — if reward climbs while MW/logP climb, the policy is\nexploiting the docking oracle.\n\n## Usage\n\n```bash\npip install -e environments/muni_bdbv_gp   # or prime env install prime/muni-bdbv-gp\n\n# required: export MUNI_TOKEN=mcli_...   (mint: muni token create --name ci --ttl 90d)\n# required: export ONEPOT_API_KEY=...    (falls back to the hackathon key)\n\nprime eval run muni-bdbv-gp -m Qwen/Qwen3-30B-A3B-Thinking-2507 -n 3\n```\n\nHosted (secrets never touch the Hub source archive):\n\n```bash\nprime eval run muni-bdbv-gp -m <model> -n 3 --hosted --allow-sandbox-access \\\n  --custom-secrets '{\"MUNI_TOKEN\": \"mcli_...\", \"ONEPOT_API_KEY\": \"...\"}' \\\n  --timeout-minutes 120 --follow\n```\n\n## Changelog\n\n- **0.2.0** — anti-reward-hacking hardening: pinned DFF pocket (no agent-chosen\n  boxes), posebusters-valid gating, MM-GBSA-primary binding term, ligand\n  efficiency, PAINS penalty, drift metrics; `check_job` polling (fixes sandbox\n  gateway 504 on long docks); auth via MUNI_TOKEN PAT (fixes OAuth refresh-token\n  revocation across sandboxes); removed `detect_pockets` (no longer needed).\n- **0.1.1** — initial SandboxEnv release.\n\n## Presentation\n\nSlide-ready charts + talk track (v0 prototype, observed reward hacking, v1\nhardening, roadmap): [`presentation/`](../../presentation/) —\n`chart1_v0_prototype.png` · `chart2_v1_agent_hacks.png` ·\n`chart3_attack_surface.png` · `chart4_roadmap.png` · `PRESENTATION.md`.\nRegenerate with `.venv/bin/python presentation/make_charts.py`.\n","encoding":"utf-8","truncated":false,"total_bytes":5247},"status":null}