Skip to content

Integrations and tool gateway

Call third-party APIs from a sandbox with no credential inside it.

An integration lets code in a sandbox call a third-party API, such as GitHub, as your organization. Sutra adds the credential to each request outside the VM. No token, key or secret is placed in the sandbox, so code you run there cannot read or leak it.

import { AnchorClient } from "@mistrive/anchor";

const client = new AnchorClient({
  baseUrl: "https://anchor.jgcp.mistrivedev.com",
  token: process.env.SUTRA_API_KEY,
  project: process.env.SUTRA_PROJECT,
});

const sandbox = await client.create({
  sandbox: {
    maxDuration: "120s",
    resources: {
      $typeName: "anchor.types.v1.ResourceAllocation",
      vcpus: 1,
      memoryMb: BigInt(1024),
      diskMb: BigInt(1024),
    },
  },
  integrations: [{ providerKey: "github-legacy", scopes: ["read:user"] }],
});

// No token in the sandbox. The platform adds credentials outside the VM.
const result = await sandbox.exec({
  command: "curl",
  args: ["-sS", "https://api.github.com/user"],
});
console.log(result.stdout);

await sandbox.delete();
import os

from mistrive_anchor import AnchorClient

client = AnchorClient(
    base_url="https://anchor.jgcp.mistrivedev.com",
    token=os.environ["SUTRA_API_KEY"],
    project=os.environ["SUTRA_PROJECT"],
)

sandbox = client.create(
    {
        "sandbox": {
            "maxDuration": "120s",
            "resources": {"vcpus": 1, "memoryMb": 1024, "diskMb": 1024},
        },
        "integrations": [
            {"providerKey": "github-legacy", "scopes": ["read:user"]},
        ],
    }
)

# No token in the sandbox. The platform adds credentials outside the VM.
result = sandbox.exec({"command": "curl", "args": ["-sS", "https://api.github.com/user"]})
print(result.stdout)

sandbox.delete()

Not available yet.

import { Sutra } from "@mistrive/sutra";

const sutra = new Sutra({
  baseUrl: "https://anchor.jgcp.mistrivedev.com",
});

const sandbox = await sutra.sandboxes.create({
  resources: { milliCpus: 1000, memoryBytes: 1024 ** 3, diskBytes: 1024 ** 3 },
  lifecycle: { timeout: { seconds: 120, action: "DELETE" } },
  integrations: [{ provider: "github" }],
});

// No token in the sandbox. The platform adds credentials outside the VM.
const result = await sandbox.processes.run({
  argv: ["curl", "-sS", "https://api.github.com/user"],
});
console.log(result.stdout);

await sandbox.delete();
from mistrive.sutra import Sutra

sutra = Sutra(
    base_url="https://anchor.jgcp.mistrivedev.com",
)

sandbox = sutra.sandboxes.create(
    resources={"milli_cpus": 1000, "memory_bytes": 1024**3, "disk_bytes": 1024**3},
    lifecycle={"timeout": {"seconds": 120, "action": "DELETE"}},
    integrations=[{"provider": "github"}],
)

result = sandbox.processes.run(argv=["curl", "-sS", "https://api.github.com/user"])
print(result.stdout)

sandbox.delete()
#!/usr/bin/env bash
set -euo pipefail

# Assumes you ran `sutra auth login` (see the Quickstart).
sutra sandboxes create gh --timeout 120s --integration github
sutra processes run gh -- curl -sS https://api.github.com/user
sutra sandboxes delete gh

Attach an integration

Pass integrations when you create a sandbox, with the provider key of each one. Supported integrations lists every provider and its key. Then call the provider’s API from inside the sandbox as usual, with no Authorization header. Sutra adds the credential on the way out.

Agents and services list integrations in their revision, and every sandbox they run gets them.

Scopes

The target API derives each integration’s scopes from what your organization allows, so you only name the provider. You can still pass scopes to ask for less.

Egress

Integrations stay reachable under every egress policy, including DENY_ALL. You do not need to add a provider’s hosts to an allow list.

Tool gateway

The tool gateway serves your integrations as Model Context Protocol (MCP) tools, so an agent can find and call them with an MCP client. It uses the same workload identity, and credentials stay outside the sandbox.

For a complete walkthrough, see Call GitHub from a sandbox. For every provider you can attach, see Supported integrations.

Type to search…

↑↓ navigate↵ selectEsc close