Skip to main content

Tool environments for the Agent Safety Bench (ASB) benchmark

Project description

agent-safety-bench-envs

Tool environments for the Agent Safety Bench (ASB) benchmark. Each environment exposes a small set of mock tools (Python callables described by JSON schemas) that an LLM agent can call. ASB pairs these environments with prompts to evaluate agent safety under prompt-injection and other adversarial conditions.

The companion prompt dataset lives on the Hugging Face Hub: aradhye/asb.

Install

pip install agent-safety-bench-envs

Quickstart

from asb_envs import EnvManager

mgr = EnvManager()
env = mgr.init_env("AccessControl_1", env_params=None)

print(env.tool_list)
print(env.get_tool_descs(["list_access_attempts"]))

result = env.call_tool("list_access_attempts", {})
print(result)

init_env(name, env_params) dynamically imports the env class and instantiates it. Each env is a subclass of BaseEnv whose tools are auto-validated against the {ClassName}.json schema shipped with the package.

Schema

Every env class has a sibling JSON file declaring its tools:

[
  {
    "name": "tool_name",
    "description": "...",
    "parameters": {
      "type": "object",
      "properties": { "...": { "type": "string" } },
      "required": ["..."]
    }
  }
]

BaseEnv.call_tool(name, args) validates required params, coerces basic types, and dispatches to the matching method on the env class.

Citation

If you use these environments, please cite the ASB paper (ICML 2026):

@inproceedings{asb2026,
  title={...},
  author={...},
  booktitle={ICML},
  year={2026}
}

License

Apache 2.0. The vendored functions_runtime.py is from agentdojo and is MIT-licensed — see NOTICE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_safety_bench_envs-0.1.0.tar.gz (509.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_safety_bench_envs-0.1.0-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file agent_safety_bench_envs-0.1.0.tar.gz.

File metadata

  • Download URL: agent_safety_bench_envs-0.1.0.tar.gz
  • Upload date:
  • Size: 509.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for agent_safety_bench_envs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8b3d2bb112bf100c132e3734d131a201fb9b745ca2bcb5044073974b2820d3c4
MD5 dec0b991b7ec4a7ce3d9cb05d65c231a
BLAKE2b-256 d71b1d95b5996499857d0f8db5719c6842e18c76dfedc5f43e86bb5eaeaef83e

See more details on using hashes here.

File details

Details for the file agent_safety_bench_envs-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_safety_bench_envs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7d98cc6097c53b1f505be1f28b8925779e9955662a227f40c79f125c52a62ed
MD5 b34b84d640f27a117a3fa0a92d8c32bc
BLAKE2b-256 ebe7756652f3aab9f7b8486476dd03f9a92114a0f878f00d6e6cab28eaa7ce1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page