feat(claude-code-plugin): add cos exec for remote code - #68
Merged
Merged
Conversation
Run untrusted code or any ad-hoc script as one source file in a throwaway CreateOS box: py/js/mjs/cjs/ts/go/sh/rb/c/cpp/rs, stdin via -i, wall-clock limit via -t (exit 124), program exit code preserved, auto-destroy. Egress is open by default; -N denies it with an IP rule. Program args after <file> are passed untouched (no long-option normalizing). Adds /createos-sandbox:exec and makes the skill reach for exec for untrusted code and ad-hoc scripts.
Port cos exec to the shared TS engine as runCode (languages, stdin, untouched args, timeout -> 124, egressDenyAll, destroy in finally; spawnSync so stderr survives exit 0) and expose it as sandbox_run_code in the OpenCode and Pi integrations. Both now point the agent at the live CreateOS Sandbox docs (llms.txt, raw .md pages).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
New
cos execverb and/createos-sandbox:execslash command: run untrusted code or any ad-hoc script as one source file in a throwaway CreateOS box, instead of on the user's machine.py js mjs cjs ts go sh rb c cpp rs(from extension or-l)-twall-clock limit (default 120 s, exit 124);cos: exit=N time=Nson stderr-p/-erestrict,-Ndenies via an unroutable IP rule (IP rules apply immediately)Skill description + "when to reach" table now steer Claude to
execfor untrusted code and ad-hoc scripts. Model:fc-sdk/examples/56-remote-code-execution.Review
Codex adversarial review findings addressed:
<file>were rewritten by the long-option normalizer →execno longer normalizes.jswas forced into ESM → runs asmain.js;.mjs/.cjsseparate||fallback masked failed runs →if/elseKnown, deferred:
-Nblocks connections but DNS lookups may still resolve, so it is not a hard exfiltration guarantee.Verified live
Python with stdin/args/non-zero exit,
--k=vargs untouched, CJSrequire/__dirname, Go, TS, JS infinite loop → 124, egress open by default vs-Nblocked, slash-command exit code preserved, zero leaked boxes.Follow-ups
Integrations/Claude-Code.mdxincreateos-v2-landingdoes not listexecyetcommands/*.mdshare the||exit-masking fallback