Skip to content

orkait/rustbox-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦀 Rustbox SDKs

Run untrusted code in a kernel-enforced sandbox. From any language.


Python TypeScript Go Rust


Official API clients for the Rustbox cloud execution engine. Built for AI agents, judging platforms, and any tool that needs to run code it didn't write.

One-line client. One method (run) for the 95% case.

🚀 Install

# TypeScript
bun add rustbox

# Python
pip install rustbox

# Rust
cargo add rustbox-sdk

# Go
go get github.com/orkait/rustbox-sdk/go@v0.1.0

⚡ At a glance

# Python
client = Rustbox(api_key)
result = await client.run(language="python", code="print(1)")
print(result["verdict"])  # AC
// TypeScript
const client = new Rustbox(apiKey);
const result = await client.run({
  language: "python",
  code: "print(1)",
});
console.log(result.verdict);  // AC
// Go
client := rustbox.New(apiKey)
result, _ := client.Run(rustbox.SubmitRequest{
    Language: "python",
    Code:     "print(1)",
})
fmt.Println(result["verdict"])  // AC
// Rust
let client = Rustbox::new(&api_key)?;
let result = client.run(&SubmitRequest {
    language: "python".into(),
    code:     "print(1)".into(),
    ..Default::default()
}).await?;
println!("{}", result["verdict"]);  // AC

📚 Per-language docs

SDK Package Docs
📘 TypeScript rustbox on npm ./typescript/README.md
🐍 Python rustbox on PyPI ./python/README.md
🦫 Go github.com/orkait/rustbox-sdk/go ./go/README.md
🦀 Rust rustbox-sdk on crates.io ./rust/README.md

🎯 Verdicts

Every result has a verdict field. What each one means and whether to retry:

Code Meaning Retry?
AC Accepted - exit 0, no limits hit n/a
RE Runtime error - non-zero exit (exception, syntax, etc.) no
TLE Time limit exceeded no - your code is too slow
MLE Memory limit exceeded no - your code uses too much RAM
SIG Killed by signal - SIGSEGV / SIGKILL / OOM-killer no
PLE Process limit exceeded - tried to fork beyond cap no
FSE File size limit exceeded - wrote too much to disk no
IE Internal error - sandbox failure on our side yes, with backoff

📏 Limits

Limit Value
Code size 64 KB
Stdin size 256 KB
Sync wait timeout 30s (SDK polls beyond this)
Webhook delivery timeout 10s

🚦 Rate limits

Profile Per minute Per day
Judge 60 1,000
Agent 1 20

Hit a 429? Back off and retry; the SDK does this automatically up to 3 attempts. Need higher limits? See your account dashboard.

🔒 Error handling

TS and Python SDKs throw typed exceptions:

Status TypeScript Python
401 / 403 RustboxAuthError RustboxAuthError
429 RustboxRateLimitError RustboxRateLimitError
5xx RustboxServerError RustboxServerError
other Error RustboxError

Go and Rust currently return generic errors. See ./ROADMAP.md.

🪝 Webhooks

Skip polling - have Rustbox POST the result to your endpoint with an HMAC signature. See ./WEBHOOKS.md.

⚙️ Base URL

Every SDK points at the production endpoint by default. No configuration needed.

https://rustbox-api.orkait.com

🛣️ Roadmap

Planned features per language: ./ROADMAP.md.

🔗 Links

About

Public mirror of the Rustbox SDKs. Auto-synced from orkait/rustbox. Read-only - PRs go to the canonical repo.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors