Engineering journal
Can an AI Tool Be Trusted Just Because Its Code Is Signed?
ToolCapsule separates publisher identity, capability policy, guest resource limits and replay evidence. A signature is one admission check, not a safety or correctness result.
Source: https://louijiecompo.com/writing/can-an-ai-tool-be-trusted-just-because-its-code-is-signed/
About 4 min read

A signature can establish which trusted publisher supplied a package and whether its signed content matches. It cannot establish what the program ought to be allowed to do, how much resource it should consume or whether its answer is correct.
ToolCapsule makes those questions separate interfaces. Its experimental Rust MVP runs signed WebAssembly command components through a library, CLI or MCP stdio adapter. This article follows merged PR #3 (opens in a new tab), revision d42dbbd, which integrates the initial package and runtime work. It is a source review, not a fresh execution or an independent security assessment.
Identity needs an operator-owned policy
The security contract (opens in a new tab) treats manifests, components, MCP input and guest output as untrusted. An operator supplies the trust store separately. Ed25519 verifies publisher identity under that trust configuration; SHA-256 binds the component bytes.
Policy starts by denying every tool. A signed manifest cannot grant itself host authority. Admission checks the tool allowlist and requested limits against host policy, rejecting excess rather than silently reducing it. Compilation and interface validation occur during execution preparation, after trust and policy verification.
These checks answer different questions. A recognized publisher can still produce a faulty component, and a correctly signed tool can request capabilities the host should refuse.
A narrow runtime makes authority inspectable
The MVP deliberately admits pure WASI 0.2 transformations. Guests receive no filesystem preopens, inherited environment, sockets, secrets or subprocess APIs. Unsupported grants fail closed. Each invocation starts with fresh guest state.
The documented default profile (opens in a new tab) allows 10 million fuel, 64 MiB guest memory, one second and 64 KiB each for input, stdout and stderr. These are configured limits, not measured performance results. Fixed clocks and seeded random bytes support deterministic fixtures; they are not a cryptographic entropy service.
The runtime's guest controls do not bound compilation or total process memory. Integrators still need separately constrained OS workers for untrusted publishers. Authentication, tenant admission, queue quotas and durable storage also belong to the integrating service. The MVP is not an independently audited multi-tenant security boundary.
A receipt supports comparison, not automatic correctness
Receipts retain digests rather than raw input and output. Replay verifies successful re-execution against the exact package, input, seed and engine profile, including fuel and output digests. The caller owns the raw replay inputs and their privacy.
Host scheduling remains observable. Timer readiness is not a recorded virtual-time trace, so a timing-sensitive component may fail replay even after an originally successful run. A mismatch should remain visible instead of becoming a claim of guaranteed reproducibility across hosts or runtime versions.
Audit hashes also need a trust anchor. The local log is neither signed nor externally anchored. Detecting modification requires retaining an earlier chain head in trusted storage; an attacker who can replace the entire log can rewrite its chain.
Even matching output is still guest output. It can be incorrect or contain prompt injection. A consuming agent must continue treating it as untrusted data.
Keep integration evidence separate from deployment assurance
The validation record (opens in a new tab) reports 16 passing tests after an MCP error-ID correction. Its coverage includes real WASI denial fixtures, exhaustion controls, tampered replay evidence, CLI subprocesses and adapter protocol errors. Integrated-main CI (opens in a new tab) passed on Windows, Linux and macOS.
That establishes named upstream checks at a pinned revision. It does not establish a production deployment, a performance benchmark, WASI 0.3 support or an independent security audit. The adapter serves one admitted tool sequentially per process and does not process cancellation while a call is running.
The useful engineering pattern is the separation itself: verify identity, authorize policy, constrain execution and retain evidence. Each boundary needs its own test, and each leaves questions that another boundary must answer.