Skip to content

Security review (M6)

Date: 2026-11-30. Scope: secrets handling, log redaction, plugin loading, agent programs and network calls in v0.1. The rules that came out of it are SEC-001 to SEC-013 in SPEC-011; each has a test in tests/conformance/test_security.py.

Trust model

  • Plugins are trusted code. Worlds, agents and evaluators are Python that runs with your permissions, whether they come from a package, a .py file or agentplaykit.yaml. AgentPlay shows a one-line notice the first time it runs code from a file or installed plugin, and agentplaykit check never imports anything. Read a downloaded scenario and its .py files before running play.
  • Model output is untrusted. Actions are checked by the world; messages and reasoning are text that may try to manipulate other agents or a judge.
  • Agent programs (command, mcp) are separate processes you chose; they get only what they need.
  • Sandbox hook points (run_episode(hooks=...)) let later releases run worlds and agents in containers. v0.1 has no sandbox.

Findings and fixes

# Finding Severity Fix
1 The HTTP client followed 301/302/303 redirects and re-sent the Authorization header to the new host (confirmed with a test server). A hostile or compromised endpoint could collect API keys. High Redirects are never followed; the error names the new location (SEC-008).
2 command agent programs inherited the whole environment, including every API key. High Programs get a minimal environment; pass_env forwards chosen variables (SEC-010). The MCP adapter does the same.
3 A key could be sent over plain http:// to a remote host. Medium Refused unless allow_insecure_http: true; local servers are unaffected (SEC-009).
4 A scenario's log.path could point at any file (for example ~/.bashrc) and overwrite it. Medium Log paths must end in .jsonl; checked in the schema, in prepare (also for --out) and in the log writer (SEC-011).
5 .eval.json results and run error messages were not redacted; a judge's error text could contain its key. Medium Results and errors are redacted with the same secret list as the log, including evaluators' own secrets (SEC-011).
6 Code loaded from .py files ran without notice. Low A one-line notice names the file (SEC-012).
7 Agents write the transcript a judge reads, so they can try to instruct the judge. Low The judge's instructions say the transcript is data and to ignore instructions in it (SEC-013). Treat judge scores as advisory.
8 SEC-006 (sandbox hook points) had no implementation. Low Hooks(wrap_world, wrap_agent) on run_episode.

Checked and found sound

  • Keys are read only from environment variables named by api_key_env; scenarios with api_key, token, secret or password fields are rejected.
  • The log writer redacts known secret values in every event; adapters also scrub keys from error text.
  • YAML is parsed with yaml.safe_load (no object construction); JSON with the standard library.
  • command uses no shell, enforces a timeout and restarts crashed programs; the program sees only the Request.
  • doctor prints the names of key variables, never their values.
  • Evaluators receive a copy of the finished log, run after agents are closed, and cannot change the log file.

Known limits

  • Redaction matches exact secret values. A secret that is transformed (split, encoded) before it reaches a log is not caught.
  • Plugins and evaluators run in-process; a malicious plugin can do anything your user can. The hook points are there for container isolation in v0.3.
  • Agents can send each other persuasive or misleading messages; that is part of what AgentPlay observes, not something it prevents.

Report vulnerabilities privately through GitHub security advisories (see SECURITY.md).