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.2.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.2.0
File Size Uploaded Provenance Actions
inspect_briq-0.2.0.tar.gz 7.8 kB With provenance Details for inspect_briq-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 17.7 kB

Release files / inspect_briq-0.2.0.tar.gz

Download URL inspect_briq-0.2.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b04694005797d5601c2cf5d1c4ebb0b33a61b32c0beb177de5091aea77a5e4da
BLAKE2b-256 checksum
How to use checksums
4274fe55399d6897ee6339c5e19045ca97eba4160f3d5c4faa8eca1f23b06d95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

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

Download URL inspect_briq-0.2.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc2b3159d67fa2b47e73407a3528289b43ac3baa321227b3b5dcf98e1eb4e405
BLAKE2b-256 checksum
How to use checksums
c9704a11d976709c2ba6cc1ddd749b7d26b76dcfd627e65bdf9397bcae92dd0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for inspect-briq 0.2.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for inspect_briq-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

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.2.0 This release

2 release files Full 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