Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Epic: guard against compound-command classification false positives (gh/rtk read pipes)

Chiusa
#16 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bash, github, typescript
Ambito
cli, security, testing

Direzione di ricerca

Start with src/tools/bash.ts and the CLASSIFIER_PROMPT definition, then inspect existing tests around matchModerateRiskTokens. Add regression coverage for compound read-only gh/rtk pipes and verify that POST/PATCH/DELETE, redirects, @file inputs, local writes, and verbatim exfiltration remain unsafe. Done means the read-only forms are SAFE without prompting and the listed outside-scope forms are not cleared.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Problem

Read-only queries piped through compound command syntax get classified as exfiltration and trigger spurious prompts:

  • cd X && rtk proxy gh pr checks 311 2>&1 | head -20 → "classified unsafe: prompt injection and data exfiltration attempt"
  • cd X && echo ... && rtk proxy gh api "repos/Rush-Auto-Works/rushautoworks/pulls/311/comments" --jq ... | head -40 → "Exfiltrates private repo data to network via gh api"

Both are read-only gh queries: they fetch data from a hosted API and send nothing local. The classifier model over-applies the "sending local data to a network endpoint" UNSAFE rule.

Root cause

Host semantics (src/tools/bash.ts): allow rules only vouch for the ENTIRE command and bail on shell control (&&, |, ;, redirects). So cd X && gh ... | head NEVER matches any bash.patterns allow rule and always reaches the model. A compound read-only pipe cannot be allowlisted.

Mitigated by a classifier-prompt carve-out (commit 5a0e44d): read-only hosted-API queries are SAFE.

Deliverable

A test corpus proving compound read-only pipes to gh/rtk are judged SAFE and do not prompt. Plainly-outside-scope shapes (gh POST/PATCH/DELETE, gh api -X POST, redirects, @file, local file writes, verbatim exfil) stay UNSAFE.

See #2 (classifier verdict eval corpus) for the broader live-model eval. This epic is the gh/rtk false-positive slice.

Suggested tasks

  1. Static test asserting the gh/read-only fetch carve-out is present in CLASSIFIER_PROMPT (guard against removal or template-literal breakage).
  2. Test that matchModerateRiskTokens does not flag a gh api GET piped to jq to head.
  3. Tests: gh read pipes SAFE; gh api -X POST / --method POST NOT cleared by any static rule.
  4. Regression test exercising the compound form cd X && gh ... | head to lock in that the carve-out, not an allow rule, keeps it safe.
Lingua principale
TypeScript
Stelle
0
Fork
1
Merge medio
3h 35m
PR unite (30g)
50

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di STRML/omp-classifier

Tutte le issue di STRML/omp-classifier

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.