# OpenKruise Agents

Give Sandcovery the domain of your OpenKruise Agents deployment, a sandbox-manager API key, and the name of a template whose sandboxes run a size Sandcovery routes.

[OpenKruise Agents](https://openkruise.io/kruiseagents) is a CNCF project that runs AI agent sandboxes on your own Kubernetes cluster. Sandcovery creates each sandbox through your deployment's sandbox-manager, which serves the E2B API, and runs commands and file transfers in the sandbox through the E2B protocol's native addresses.

- **Domain**: your deployment's E2B domain, such as `kruise.example.com`, with no scheme, path, query, or fragment. A port is allowed, such as `kruise.example.com:8443`. Sandcovery calls `https://api.<domain>` for the management API and `https://<port>-<sandbox ID>.<domain>` for each sandbox, and sends your API key only to those hosts.
- **API key**: a sandbox-manager API key. Sandcovery sends it in the `X-API-Key` header.
- **Template**: the name of a SandboxTemplate or SandboxSet that your key can use. Every create names it.

## What the deployment needs

Install OpenKruise Agents and its sandbox-manager as the [installation guide](https://openkruise.io/kruiseagents/installation) describes, then set up the E2B native protocol as the [E2B client manual](https://openkruise.io/kruiseagents/user-manuals/e2b-client) describes:

- Point the DNS name `api.<domain>` and the wildcard `*.<domain>` at the sandbox-manager's ingress.
- Serve a certificate for both names from a public certificate authority, since Sandcovery calls from Cloudflare Workers, which accept no certificate from a private authority.
- If you set a static E2B domain on the sandbox-manager, it must equal the credential's domain. Leaving it empty lets the sandbox-manager answer for the host each request names.

Sandcovery does not use the manual's private protocol, which serves the API at `<domain>/kruise/api`, or its URL-parameter access.

## What the template needs

OpenKruise Agents fixes a sandbox's size in its template, so Sandcovery reads the vCPUs and memory the new sandbox reports and keeps it only when they match the size the request asked for. The template's CPU limit must be a whole number of vCPUs, since the sandbox-manager reports a fractional limit rounded down, so a limit of 2.5 vCPUs reads as 2 and Sandcovery cannot tell it apart. The template's memory limit must match one of the sizes below.

| Option | Support |
| --- | --- |
| Size | `1x2`, `2x4`, `4x8`, and `8x16`, each only where the template runs it |
| Disk and image | Whatever the template sets |
| Environment variables | Yes |
| Egress | `allow_all`, within your cluster's own network |
| Lifetime | Until the sandbox's TTL |
| Pause and resume | Yes |
| Region | Where your cluster runs |

Snapshots, port previews, custom images, idle timeouts, disk sizes, egress limits, region choice, and GPUs are not available on this provider. OpenKruise Agents enforces a sandbox's network rules only when its template runs the `traffic-proxy` runtime and accepts them without enforcing them otherwise, so Sandcovery sends none. A create that asks for any of these, or for a size the template does not run, routes to another provider.

When a new sandbox runs a different size than the request asked for, Sandcovery deletes it and tries the next provider.

## Costs

OpenKruise Agents is free software under the Apache License 2.0, so Sandcovery lists it at $0 for every size, and its estimates and spend limits count its sandboxes at $0. Your cluster's nodes bill whatever their provider charges, which Sandcovery does not read.
