Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Cerrado
#16 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
75/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
bash, github, typescript
Área
cli, security, testing

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
TypeScript
Estrellas
0
Forks
1
Merge medio
3 h 35 min
PR fusionados (30 d)
50

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de STRML/omp-classifier

Todos los issues de STRML/omp-classifier

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.