Description
CodeBox.run() returns a string that includes ANSI-colored seccomp warning messages from the container runtime, mixed in with the actual program output.
Reproduction
import asyncio
import boxlite
async def main():
async with boxlite.CodeBox() as codebox:
result = await codebox.run("print('hello')")
print(repr(result))
asyncio.run(main())
Expected
Actual
'hello\n\x1b[2m2026-02-12T02:16:34.805467Z\x1b[0m \x1b[33m WARN\x1b[0m \x1b[2mlibcontainer::process::init::process\x1b[0m\x1b[2m:\x1b[0m seccomp not available, unable to set seccomp privileges!\n'
Environment
- boxlite 0.5.10
- macOS Apple Silicon (Hypervisor.framework, no seccomp)
Impact
Any code that parses run() output will break because of the injected warning. This is especially problematic for AI agent use cases where the LLM needs to interpret clean output.