# Security

## Reporting a vulnerability

Use GitHub private vulnerability reporting: open
<https://github.com/amarjaleelbanbhan/aas-rs/security/advisories/new>, or go
to the repository's **Security** tab and choose **Report a vulnerability**.
Do not open public issues for vulnerabilities. There is no security email
address.

This is a volunteer-maintained experimental project. There is no response-time
guarantee.

## What AAS-RS is, and is not

AAS-RS evaluates observable agent behaviour on a benchmark. It does not make
agents safe. It is not an authorization system, a sandbox or a runtime guard,
and it is not production-secure software.

## What gets executed

| process | code | where it comes from |
|---|---|---|
| environment server, one per task | upstream `src/runtime/task_mcp_server.py` plus the 42 `environments/*/environment.py` | the upstream git checkout and the Hugging Face dataset snapshot you downloaded |
| official evaluator (only with `aas-rs official --run-judge`) | upstream `eval/runner.py` | upstream checkout |
| your agent | your code, in the aas-rs process | you |

The environment code ships **with the dataset** and runs as Python with your
user's privileges. Treat a dataset snapshot as code: pin the revision (AAS-RS
records it in every report) and do not run untrusted snapshots.

## Isolation: what exists

- **No secret inheritance.**
  - The environment server starts from an empty environment. It gets only
    `AGENTABSTAIN_DATA`, Python hygiene flags and `PATH`, `SYSTEMROOT`,
    `TEMP`, `TMP`, `LANG`. Tested in `tests/mock_runner.rs`.
  - The evaluator subprocess additionally gets `HOME`, `OPENAI_API_KEY` and
    `OPENAI_BASE_URL`, and nothing else. Tested in
    `tests/official_subprocess.rs`.
- **Fresh state per task.** Every task variant gets its own server process.
  It is shut down after the task, and killed if the run is cancelled.
- **Limits.**
  - Startup timeout, per-call timeout, per-task wall-clock timeout.
  - Per-task tool-call budget, which also counts calls the Rig adapter rejects.
  - Bounded concurrency (`--jobs`).
- **Hidden runtime tool.** The state-export tool is not shown to agents, and
  calls to it are refused.
- **Credentials.**
  - The LLM key is read from `AAS_LLM_API_KEY` and sent only to the configured
    endpoint. It is redacted in `Debug` output and never written to reports.
    Tested.
  - The CLI prints environment values of non-secret variables (paths) in
    `--help`, never keys.
- **Local only.** No telemetry, no uploads. Reports are written only where you
  ask. They contain tool arguments, tool results and the model's final
  answers.

## Isolation: what does NOT exist

- **No OS-level sandbox.** Environment servers are ordinary processes. There
  is no container, namespace, seccomp, AppArmor, Windows job object, or
  CPU/memory limit.
- **No filesystem isolation.** The process can read and write anything your
  user can.
- **No network isolation.** The Python process can open network connections.
  Nothing blocks it.
- **No output redaction.** Secrets an agent writes into its answer end up in
  the report.

What limits risk today is what the upstream environments do, not what AAS-RS
enforces. A static scan of the 42 `environment.py` files at dataset revision
`842228426c2a` found:
- imports limited to `dataclasses`, `datetime`, `uuid`, `json`, `math`, `re`,
  `copy`, `collections` and `os` (used only for `os.path` string operations);
- no `open(`, `subprocess`, `socket` or HTTP client.

The tools mutate in-memory Python objects: "delete file" or "send email" does
not touch your real files or mail. **A static scan is not enforcement.** It
must be repeated for every new dataset revision, and it says nothing about
dependencies such as fastmcp.

If you run AAS-RS on a shared machine, or against a dataset you have not
reviewed, run it inside a container or VM. Enforced isolation is open work
(see the issue tracker).

## Network access during a run

| component | network |
|---|---|
| deterministic baselines + commit check | none required |
| `--policy llm` | HTTPS to `AAS_LLM_BASE_URL` (default `https://api.openai.com/v1`) |
| `official --run-judge` | the official judge calls OpenAI (or `OPENAI_BASE_URL`) |
| environment servers | not required; not blocked |

## Threats considered

| threat | status |
|---|---|
| Prompt injection via tool results | Part of the benchmark itself (e.g. `emergent_risk_discovery`). Results are passed through unmodified. |
| Malicious tool descriptions | They come from upstream code and are passed through. Pin revisions. |
| Agent calling hidden or unknown tools | The server rejects unknown names (MCP error, not committed). The Rig adapter rejects names outside the tool list before sending. |
| Agent reading oracle state | The export tool is hidden and refused. |
| Hung or crashing server | Timeouts; recorded as a failure and excluded from scores; no orphan processes (tested on Linux). |
| Cross-task contamination | One process per task. |
| Credential leakage to subprocesses | Cleared environment; explicit allow-lists (tested). |
| Credential leakage to reports or logs | `Debug` redaction; reports never contain configuration (tested). |
| Malicious dataset snapshot | **Not mitigated.** Environment code runs unsandboxed. |
