Tools/google/sandboxed-api

sandboxed-api

Generate sandboxes for C/C++ libraries automatically

1.8kemergingC++Apache License 2.0trending

The Lens

By Erik Loyd, SaaS CEO and former COO/CFO of an AWS Premier Partner.

Updated Sep 2026

Sandboxed API takes a C or C++ library you do not fully trust, an image parser, a font renderer, a decompressor, and puts it in its own locked-down process so a memory bug in that library cannot reach the rest of your program. Google built it on top of Sandbox2 and uses it internally. The working motto is sandbox once, use anywhere: you write the policy for a library a single time and every project that needs that library reuses it. Apache 2.0.

Getting there is real engineering. Builds run under Bazel or CMake, it is Linux-only, and each sandboxed library gets a tightly scoped security policy plus generated RPC stubs for calls that now cross a process boundary. That boundary is also a performance and data-marshalling cost you have to design around. This is infrastructure work measured in days, not an afternoon.

Free, entirely, with no commercial edition. The teams that should care are the ones shipping C or C++ that touches untrusted input: file format parsers, media pipelines, anything processing user uploads. Everyone else does not need this. For sandboxing whole workloads rather than a single library, gVisor or Firecracker are the different tool.

The catch is that it only helps if you were already going to do this work. Sandboxing changes your calling convention, and a team that will not maintain a per-library policy will end up with a sandbox that is permissive enough to be theater.

Free vs Self-Hosted vs Paid

fully free

Free (Open Source)

  • Apache 2.0, maintained by Google, built on Sandbox2
  • Per-library sandboxing for C and C++ with automatically generated API stubs
  • Tightly scoped security policies that are written once and reused across projects
  • Bazel and CMake build support
  • Linux only

Paid

None. There is no commercial edition or support contract from Google.

Self-Hosted Costs

$0 in licensing. The real cost is engineering: writing and maintaining a security policy per sandboxed library, adapting to a process boundary in the middle of what used to be a function call, and absorbing the IPC and marshalling overhead in your hot paths. Budget days per library, plus ongoing maintenance when the library or its syscall usage changes.

When to Pay

Nothing to buy. The spend is developer time, and it is only worth it when the library in question handles untrusted input.

Completely free and open source under Apache 2.0. The cost is engineering time to write and maintain a security policy per library.

What to do by team size

Solo
free, but this is rarely worth a solo project's time
Small team
free; worth it only if you parse untrusted input in C or C++
Medium team
free; one engineer owning sandbox policies is the realistic staffing
Large team
free; the reuse model pays off across teams sharing the same libraries
Self-hosting ops:significant

Get tools like this every Wednesday

One featured tool, three on the radar. No fluff.

Score
76/100 · B+
Adoption13/30
Maintenance25/25
Community13/20
License15/15
Analysis10/10

A low score is not a verdict on quality. Young and niche tools start low by design. How we calculate scores

Trust Signals

Organization account (2897 public repos)Notable author: 77,537 followersBacked by: Google / AlphabetAuthor also built: google/artemis (110 stars)

License: Apache License 2.0

Use freely. Patent grant included.

Commercial use: ✓ Yes

About

Owner
Google (Organization)
Backed by
Google / Alphabet
Stars
1,761
Forks
199

Also by Google

Explore Further

More tools in the directory