Selvedge și execuție cu dovezi
A sandbox is not a witness
Running untrusted code is one of those ideas that sounds fine in a meeting because nobody has drawn the incident report yet. Let the agent call a tool. Let the plugin transform a file. Let the partner module process the data. Put it in a sandbox. Lovely. The code cannot escape. Everyone nods. Then the auditor asks what the code actually did inside the sandbox, and suddenly the room discovers that containment is not the same as evidence.
A sandbox answers one question: did the workload stay inside the boundary? That is necessary. It is not enough. The harder question is what happened during the run. Which artifact executed? Which policy was applied? Which capabilities were requested? Which host calls were allowed or denied? How much fuel, memory and time did it spend? What came out? Can the run be replayed without trusting the original machine? If those answers live in logs and confidence, the system has a costume, not an audit trail.
Selvedge exists for that gap. The page calls it the execution transcript layer for untrusted code: AION proves reasoning, Ledger records system events, and Selvedge captures execution. The implementation follows that shape. The workspace is a Rust 2024 project with crates for core digests and resource limits, execution engines, Wasmtime and Kera backends, determinism, WASI and Kera hosts, policy, AION verification, CLI, MCP, registry, runner, daemon, audit and guest SDK surfaces. The public promise is intentionally plain: Selvedge executes untrusted code under deterministic execution, policy enforcement and verification discipline.
The useful distinction is small and brutal. A sandbox says the code did not leave. Selvedge is designed to say what the code did.
The transcript is not a log
Logs are useful for humans who are already debugging. They are less usefulwhen the question is whether a run can be verified later by someone who did not trust the original host. A log line can be missing, reordered, filtered, truncated, reformatted, or explained away. A transcript has to be part of the execution contract.
Selvedge core defines SHA3-256 digests, error types, path validation, authentication tokens and shared resource limits. The README describes transcripts with hashes of bytecode, settings, stdout, stderr, output, memory and globals, plus fuel consumption and host call counts. The page describes every host call being hashed into a SHA3-256 chain and the result wrapped in an AION-style proof envelope with Ed25519 sealing. That is the difference between a system saying trust me and a system saying here is the packet.
There is a healthy bit of paranoia in that design. The artifact digest names the code. The settings digest names the deterministic profile. The transcript names what crossed the host boundary. The signed envelope makes tampering visible. Offline verification means the original runtime is not the only witness. This is the part many sandbox stories skip because it is less fun than showing a plugin running in a demo. Demos rarely ask who edited the audit log. Auditors do.
Default deny needs receipts too
Defaultdeny este o postură bună și un slogan teribil dacă rămâne doar la slide. Politica Selvedge dă dinți sloganului. Crate-ul de politici definește capabilități WASM precum clock, random, filesystem, network, environment, stdio, process și custom. Acesta include limite de resurse pentru memorie, dimensiunea fișierelor, numărul de instrucțiuni și timp. Validează invarianți, respinge capabilități duplicate, oferă erori structurate și mapează eșecurile în vocabularul comun de erori Dweve. Runner-ul aplică apoi limitele de resurse la configurația de execuție înainte ca workload-ul să înceapă.
Asta înseamnă că politica nu este un chestionar completat după rulare. Este un input pentru execuție. Dacă workload-ul cere acces la timp, aleatoriu, filesystem, rețea, environment sau proces, acea cerere trebuie să treacă de politică. Dacă consumă prea mult fuel, memorie sau timp wall-clock, rularea se încheie ca un eșec controlat. Dacă o politică este inconsistentă, ar trebui să eșueze înainte ca artifact-ul să înceapă să facă ceva interesant. Foarte plictisitor. Foarte util. Plictiseala este modul în care ne păstrăm weekendurile.
Punctul important este că deciziile de politică nu sunt separate de dovezi. Un sandbox poate permite sau refuza o categorie largă și totuși să lase un audit trail subțire. Selvedge este construit în jurul ideii că fiecare decizie de gate și fiecare citire de resursă aparține poveștii rulării. Asta îl face util pentru unelte de agenți, execuția de pluginuri terțe, inferență Kera, workload-uri reglementate și cod de parteneri. Munca poate fi nesigură. Dovada nu ar trebui să fie.
Determinismul este locul unde host-ul încetează să improvizeze
Replay-ul este ușor de promis și greu de păstrat. Host-ul are un ceas. Host-ul are aleatoriu. Comportamentul NaN în virgulă mobilă poate fi incomod. SIMD poate diferi între arhitecturi. Filesystem-urile, variabilele de environment și starea proceselor sunt modalități excelente de a strecura nondeterminism în locuri unde nimeni nu se aștepta. Dacă vrei replay, trebuie să elimini sau să controlezi aceste surse înainte să devină scuze.
Selvedge face execuția deterministă implicită. README-ul descrie un ceas virtual fixat la epoca 2024-01-01, aleatoriu ChaCha20 cu seed, măsurarea fuel, generarea transcriptului și canonizarea NaN. De asemenea, spune că detecția SIMD este cea mai rapidă, dar doar pe aceeași arhitectură, în timp ce dezactivarea SIMD este ruta complet portabilă cross-platform. Ultima parte contează pentru că determinismul nu este o rugăciune. Este o decizie de configurare și arhitectură, iar uneori compromisul onest este viteza pentru portabilitate.
Runner-ul folosește implicit backend-ul Wasmtime cu execuția deterministă activată. Kera este celălalt backend, destinat workload-urilor Graph IR și rețelelor neuronale binare. Această împărțire este sensibilă. WASM este calea generală pentru componente nesigure. Kera este calea pentru grafuri AI. Ambele au nevoie de aceeași disciplină înconjurătoare: politică înainte de execuție, setări deterministe, transcript după execuție și dovadă în jurul rezultatului.
De ce agenții fac asta mai puțin opțional
Agent systems make untrusted execution fashionable again, which is a sentence that should make every security person sit up a little straighter.A model asks for a tool call. A plugin runs a transformation. A generated helper script touches data. A partner tool comes through MCP. The model did not write the tool, the tool may not be reviewed with the same care as product code, and the user still expectsthe system to explain what happened. Good luck with that if the only answer is a log directory and vibes.
Selvedge has an MCP server surface for agent tools, a CLI for build, verify, run and replay style workflows, a daemon for long-running execution, runner pooling and cache warming, registry client and server crates, and a guest SDK. The point is not that every surface is the same. The point is that the evidence shape should be comparable. Whether a workload enters as a WASM component, a Kera graph, an agent tool or a service job, the run should end with something you can verify.
Performance is atrade, not a spell
The Selvedge page includes benchmark numbers from the repository BENCHMARKS.md: cold start is the headline win, the hot path is more nuanced, Kera JIT has a warm graph story, and vanilla Wasmtime still holds some repeated-call hot paths. That is the right way to talk about it. Runtime work is full of tradeoffs. If a component model produces a transcript and a proof envelope, it has different costs than the bare minimum path. If cold start is your pain, that evidence path may help. If the workload is a tight repeated call with no need for transcript overhead, the answer may be different. Very inconvenient, reality. It refuses to be a brochure.
The article version of the performance story is therefore simple: choose the runtime for the workload.Do not use a proof envelope as a magic speed potion. Use it when the cost of not having replayable evidence is higher than the overhead. For agent tools, regulated data processing, third-party plugins and execution where a later human will ask what happened, that cost is often real.
What to review before using it
First, decide whether you need containment, evidence, or both. If the workload is trusted and internal, Selvedge may be more machinery than needed. If the workload is untrusted, partner-supplied, model-triggered or audit-facing, the transcript begins to earn its place.
Second, review the policy. Which capabilities are allowed? Which are denied? What are the fuel, memory and time limits? Is deterministic mode required or merely permissive? Are filesystem and network access narrow enough? Is the policy versioned with the artifact? If policy lives in a wiki and execution lives somewhere else, the design is already drifting.
Third, test replay as a product behaviour. Do not wait for an audit to discover whether the envelope verifies offline. Run the same artifact, same policy and same inputs twice. Compare transcripts. Try denied capabilities. Break the checksum. Change the seed. Disable SIMD if cross-platform identity matters. The annoying tests are the point.
The lesson
Selvedge is not a prettier sandbox. It is an execution evidence layer. It runs WASM and Kera artifacts, starts from default deny, constrains resources, controls deterministic inputs, hashes execution into transcripts, and wraps results in a proof envelope that can be checked later. That is a different promise from the code stayed in its corner.
Pe măsură ce sistemele AI apelează la tot mai multe instrumente, rulează tot mai multe ajutoare generate și acceptă tot mai multe componente terțe, această distincție încetează să mai fie una academică. Întrebarea nu va mai fi doar dacă volumul de lucru a scăpat. Întrebarea va fi ce a făcut, sub ce politică, cu ce intrări, producând ce ieșiri, și dacă altcineva poate reda acea afirmație.
Un sandbox este un zid. Selvedge încearcă să fie și martorul.