Skip to main content

inspect-briq

ci PyPI license: MIT

Run Inspect AI sandboxes on briq. Each sample gets its own microVM, destroyed when the sample ends.

from inspect_ai import Task, task
from inspect_ai.dataset import Sample
from inspect_ai.scorer import includes
from inspect_ai.solver import generate, use_tools
from inspect_ai.tool import bash
from inspect_ai.util import SandboxEnvironmentSpec
from inspect_briq import BriqSandboxEnvironmentConfig


@task
def kernel():
    return Task(
        dataset=[
            Sample(
                input="Run `uname -s` with the bash tool and tell me its output.",
                target="Linux",
                files={"notes.txt": "one file per sample, copied in before the first message"},
            )
        ],
        solver=[use_tools(bash(timeout=30)), generate()],
        scorer=includes(),
        sandbox=SandboxEnvironmentSpec("briq", BriqSandboxEnvironmentConfig(size="medium")),
    )
pip install inspect-briq
export BRIQ_API_KEY=...
inspect eval kernel.py --model anthropic/claude-sonnet-4-5

sandbox="briq" uses the defaults. Python 3.11 or later (what Inspect needs), asyncio backend.

Configure

BriqSandboxEnvironmentConfig, or a JSON file with the same fields: sandbox=("briq", "briq.json").

Field Default Means
size the API's default small, medium, large or xlarge. Anything else fails unsupported.
image briq's sandbox image An OCI image.
sleep 30m Idle time before the sandbox sleeps: 30m, 3h, 7d, never.
working_dir /work Where commands run and relative paths resolve.
env none Variables of the sandbox. They show in its status and in the eval log.
secret_env none Names of variables of the eval process, sent write-only. Needs API support.
default_exec_timeout 600 Seconds for a command that has no timeout. It raises TimeoutError.
wait_timeout 120 Seconds to wait for a sandbox to start.
base_url BRIQ_API_URL, or the public API The briq API.

The API key is read from BRIQ_API_KEY only: a key in the configuration would end up in the eval log.

BriqSandboxEnvironmentConfig(
    size="large",
    env={"MODE": "test"},
    secret_env=["GITHUB_TOKEN"],  # read from os.environ, never stored in the log
)

secret_env fails with unsupported when the API cannot keep a value write-only. It never falls back to a plain variable.

What is supported

Inspect On briq
exec with cwd, env, timeout, input Yes. input is text: bytes that are not UTF-8 fail unsupported.
exec(user=...), read_file(user=...), write_file(user=...) No: SandboxUserUnsupportedError. Commands run as the sandbox's own user.
read_file, write_file Yes. Missing directories are created. A file over 100 MiB fails.
Sample files and setup Yes, through write_file and exec.
One sandbox per sample Yes, named default.
Several named sandboxes per sample No.
connection() (inspect sandbox shell) No.
Docker compose.yaml and Dockerfile No. Use image.

timeout_retry and concurrency have no effect: a command that outlives its timeout is stopped and raises TimeoutError at once. Limit parallel sandboxes with --max-sandboxes.

Errors:

Raised When
FileNotFoundError The file does not exist.
TimeoutError A command or a call outlived its timeout.
SandboxUnavailableError The sandbox is gone or briq could not take the call.
OutputLimitExceededError Output or a file is over Inspect's limit.
briq_cloud.BriqError Anything else: quota, credits, plan, a wrong key. It has a stable code.

A command whose end is not known raises BriqError with code="outcome_unknown". It is never repeated.

Clean up

A sample's sandbox is destroyed when the sample ends, also when it fails or is cancelled. If the evaluation is killed, its sandboxes stay: they sleep after sleep and are not billed while asleep. Destroy them from the dashboard, or with briq_cloud: AsyncBriq().sandbox(id).destroy().

Develop

Needs uv.

uv sync
uv run pytest          # offline, the briq client is faked
uv run ruff check . && uv run ruff format --check .
uv run mypy

License

MIT

Metadata

Release files for inspect-briq 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inspect-briq 0.1.0
File Size Uploaded Provenance Actions
inspect_briq-0.1.0.tar.gz 7.8 kB Without provenance Details for inspect_briq-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for inspect-briq 0.1.0
File Interpreter ABI Platform Actions
inspect_briq-0.1.0-py3-none-any.whl Python 3 none any Details for inspect_briq-0.1.0-py3-none-any.whl

Total release size: 17.7 kB

Release files / inspect_briq-0.1.0.tar.gz

Download URL inspect_briq-0.1.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
348cbd89b3130cc3e3a828adfb50ecab8156bdd9ca490672c6da936a1aaf1086
BLAKE2b-256 checksum
How to use checksums
db23cde6cf1dbd8b52efbabec4a72a37850b0de9b4ac34fbb87b7f4cc7e92e14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / inspect_briq-0.1.0-py3-none-any.whl

Download URL inspect_briq-0.1.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac82754043fbb043a389d9d80cac91f6f007d90609e2c1037807cad3aa1811ff
BLAKE2b-256 checksum
How to use checksums
94eb8a582db93f0b657f63608052b4bb482af316b408969f4687669418229304
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for inspect-briq 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page