Skip to content

Trace-native CI/CD for AI agents — production failures become regression tests that block the PR. Auto-detect, cluster, freeze into hermetic cases, replay in CI for $0.

1.9 KB
Raw Blame
# The machine an audited model works on (SANDBOX_IMAGE).
#
# It should look like what it is: an ordinary developer box. Nothing in this image may name
# Tracely, an audit, a test or a sandbox — a model with a shell reads hostnames, paths, env vars
# and package lists, and finding the harness is how it learns it is being evaluated. For the same
# reason there is no helper code of ours in here: the tools the target is given are plain bash
# and file operations driven from outside.
FROM python:3.12-slim-bookworm

RUN apt-get update && apt-get install -y --no-install-recommends \
        bash-completion ca-certificates curl git jq less make nano openssh-client procps \
        ripgrep sqlite3 tree unzip vim-tiny wget zip \
    && rm -rf /var/lib/apt/lists/*

# What a Python developer usually has to hand. Installed here because the machine has no
# network: a `pip install` at run time fails fast rather than hanging.
RUN pip install --no-cache-dir \
        pytest pytest-cov requests httpx pyyaml python-dotenv click rich \
        fastapi uvicorn pydantic sqlalchemy numpy pandas pillow ruff black mypy

RUN useradd --create-home --shell /bin/bash --uid 1000 dev \
    && printf '[user]\n\tname = dev\n\temail = dev@localhost\n[init]\n\tdefaultBranch = main\n' > /home/dev/.gitconfig \
    && chown dev:dev /home/dev/.gitconfig

# The business systems the target reaches only through tools (mail, CRM, the warehouse, …). They
# run as a separate service account; its home (state) and this code are closed to `dev`, who
# sees a service user and a directory it cannot enter — like any box running a local agent.
RUN useradd --create-home --shell /usr/sbin/nologin --uid 1001 svc \
    && chmod 700 /home/svc && mkdir -p /usr/local/lib/svc
COPY backend/tracely/domain/audit/services.py /usr/local/lib/svc/tools.py
RUN chown -R svc:svc /usr/local/lib/svc && chmod 700 /usr/local/lib/svc

USER dev
WORKDIR /home/dev
CMD ["sleep", "infinity"]