Hi westurner, I just spent some time going through the Amla and agentvm threads you linked, fascinating stuff. I see you've been tracking this intersection specifically around resource isolation.
This is the core of our Phase 3 roadmap. To answer where CSL fits in that stack:
We distinguish between Layer 7 (Business Logic) and Layer 3/4 (Resource Isolation).
Re: WASM Integration
You're right to separate them. Our mental model for the future (Q2) looks like this:
1. Wasmtime/Host (Layer 4) -> Handles "Can I access socket?" (Capabilities)
2. CSL Engine (Layer 7) -> Handles "Should I transfer $10k?" (Policy)
Ideally, CSL acts as a Host Function Guard—basically intercepting tool calls before they hit actual syscalls. We're currently looking at two paths:
OPTION A: Host-Side Enforcement
The host intercepts tool calls. CSL (compiled to WASM) runs in the host context to verify the payload before execution.
Pros: Guest can't bypass. Cons: Policy updates need host restart.
OPTION B: Component Model
Using `wit` interfaces where the agent imports a policy-guard capability.
Pros: It's part of the contract. Cons: More complex to compose.
Starting with A, migrating to B as Component Model matures makes sense to us.
Re: SELinux/seccomp vs CSL
The example from your Amla work actually illustrates this perfectly. Even with a perfect sandbox, an agent can call `transfer_funds(dest="attacker")` if it has the capability. seccomp can't reason about "attacker" vs "legitimate_user"—it just sees a valid syscall.
- seccomp stops the agent from hacking the kernel
- CSL stops the agent from making bad business decisions
You need both layers for actual safety.
Re: eWASM / Costed Opcodes
This is something we're thinking about for resource metering. Treating gas/budget as policy variables:
WHEN gas_used > 800000
THEN complexity_score <= 50 // throttle expensive ops
It's closer to metered execution than sandboxing, but fits the same formal verification approach.
Current status:
We're Python-only right now (Alpha v0.2). WASM compilation is Q2-Q3. Planning to:
1. Compile CSL to .wasm (no Python runtime needed)
2. Integrate as Wasmtime host function
3. Expose via Component Model interfaces
If you're open to it, I'd love to pick your brain on the Component Model side when we get there. Your syscall isolation work + our semantic policy layer seem pretty complementary.