Explicit permissions object replaces the secure default instead of merging over it (drops binding auto-grant)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
- #1964 de @roli-lpci — cerrado sin fusionar
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- security
Línea de trabajo
Comienza en packages/core/src/agent-os.ts alrededor de la línea 3276 y, después, compara el comportamiento con docs/content/docs/permissions.mdx alrededor de la línea 32. Verifica cómo se combinan los permisos explícitos con la línea base y cómo el registro de bindings afecta al ámbito de los bindings. Añade cobertura para una política explícita de solo red que conserve la línea base documentada y para que los bindings sigan estando permitidos; después, ejecuta las pruebas relevantes de core.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Split out from #1884 so that #1958 (which fixes the other half of that report — network rule patterns never matching the URI-formatted resource) can close cleanly without silently closing this one.
Problem
The permissions docs state that a partial policy is merged over a secure default:
Your policy is merged over this baseline. Omitted scopes keep their default; they are not denied. So
{ network: "allow" }grants the network while keeping the execution essentials.
— docs/content/docs/permissions.mdx:32
The implementation does a wholesale replacement instead:
// packages/core/src/agent-os.ts:3276
const hostPermissions = options?.permissions ?? {
...allowAll,
binding: "allow",
};
The ?? only supplies the default when permissions is entirely absent. Any explicit object replaces it in full.
Consequences
-
Omitted scopes are denied, not defaulted.
{ network: "allow" }leavesfs,childProcess,process, andenvundefined. Whatever the sidecar treats as the missing-scope default applies — not the documented baseline — so the documented one-liner for "grant the network, leave everything else alone" silently removes the execution essentials. -
The
bindingauto-grant is lost. The docs saybindingis auto-granted when bindings are registered. Because thebinding: "allow"in the fallback lives inside the branch that only runs when no policy is passed, registering bindings alongside any explicit policy leavesbindingundefined → denied. -
It masks unrelated bugs. Verifying #1958's fix end-to-end requires spelling out all six scopes in the repro, otherwise
{ network: { default: "deny", rules: [...] } }alone also deniesfs/processand the failure looks like a network-policy bug. The original reporter in #1884 hit exactly this.
Reproduction
import { AgentOs } from '@rivet-dev/agentos';
// Documented as: grant network, keep execution essentials.
const vm = await AgentOs.create({ permissions: { network: 'allow' } });
await vm.filesystem.writeFile('/tmp/t.js', 'console.log("hi")');
// fs/process operations do not behave as the documented baseline implies
Reported against 0.2.15 and 0.2.16-rc.1 in #1884.
Suggested fix
Merge scope-by-scope over the baseline rather than replacing:
const hostPermissions = {
...allowAll,
binding: "allow",
...(options?.permissions ?? {}),
};
…with the binding auto-grant applied whenever bindings are registered, independent of whether an explicit policy was supplied. Either that, or update permissions.mdx to document replacement semantics — but the merge behavior is the one the docs promise and the safer default, since the failure mode of replacement is silent over-denial.
Worth a test asserting that { network: "allow" } leaves fs at its documented baseline, and that registering a binding with an explicit policy still grants binding.
/cc @Scorpion197 — this is the half of #1884 your PR intentionally doesn't cover.
- Lenguaje dominante
- Rust
- Estrellas
- 4.8k
- Forks
- 272
- Merge medio
- 13 h 24 min
- PR fusionados (30 d)
- 49
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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rivet-dev/agentos
-
Dificultad 3/5 Medio día Aptitud para principiantes 32/100
rivet-dev/agentos#2020 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Inline JavaScript resolves dynamic import() from / instead of the working directoryPosiblemente ocupada @mittal-parth la tomó hace 37 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
rivet-dev/agentos#1973 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
-
Guest-execution slot counter has no near-threshold warningPosiblemente ocupada @SparshSunilNaik la tomó hace 58 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
Todos los issues de rivet-dev/agentos
Issues similares
-
area:io kernel-paused needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bherbruck/solvecraft#7854 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
transit-audio/transit#159 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
HakanSeven12/OpenCADStudio#2257 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
priority: low ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
storytold/photocraft#9884 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
triage: new type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Jagalite/superseedr#376 ·
Los mantenedores suelen responder en 1 día