Skip to main content

dtap-openclaw-target

A superred Target that runs the OpenClaw CLI agent against the DecodingTrust-Agent (DTAP) task environments, as one of the two concrete agents in the DTAP port (the other is Claude Code). It is a thin OpenClaw-specific layer over the shared, frozen dtap_scaffold base, which supplies everything agent-agnostic: the security-domain forest, the five DTAP injection vectors, env activation by config, the host MCP proxy / Docker-env / injection lifecycle, the emit-once observables, and the query surface the DTAP claim's out-of-band judge reads.

In the project's target taxonomy (chatbot < agent < assistant) this is an agent: a tool-calling agent driven over MCP servers, additionally holding its own native exec/fs tools.

What it adds over the base

DtapOpenClawTarget implements only the four agent-specific hooks the base calls; the base owns the run loop, the vectors, and the observables.

  1. _agent_kind -> "openclaw".
  2. _native_tool_deny(policy) -> maps the native_tools_policy config slot to OpenClaw's tools.deny: "enabled" (default) denies nothing (native exec/fs stay on), "disabled" denies ("exec", "fs") (configurable). Upstream DTAP disabled native tools for the filesystem domain; this port enables them because the agent runs in a throwaway container (see ASSUMPTIONS B).
  3. _run_episode(spec) -> runs ONE OpenClaw episode in an isolated Docker container (node:24 + openclaw), behind the single monkeypatchable _docker_run seam. The host writes a per-profile openclaw.json (provider -> the LiteLLM proxy, mcp.servers -> the host proxy, native tools on), AGENTS.md (the system prompt), any injected skills, and a task.json (the turns) into a bind-mounted state dir, then docker run drives the turns exactly as upstream does on the host (openclaw --profile <id> agent --local --message <turn> --session-id <id> with OPENCLAW_TRAJECTORY=1).
  4. _extract_trajectory(episode) -> parses OpenClaw's session-trajectory JSONL (trajectory.convert) into a TrajectoryArtifact, faithfully reproducing upstream's converter but splitting env/MCP tool calls (already emitted by the proxy) from the agent's native tool calls, and rebuilding the DT-Arena trajectory_json the judge consumes.

Usage

from dtap_openclaw_target import DtapOpenClawTarget

target = DtapOpenClawTarget(
    model="openai/gpt-4o-2024-05-13",      # routed through the LiteLLM proxy
    api_base="https://my-litellm-proxy/",
    api_key="sk-...",
    state_root="/path/to/run/state",        # bind-mounted into the container
    # OpenClaw-specific construction concerns:
    image="decodingtrustagent/dtap-openclaw:openclaw-2026.4",
    provider_api="openai-completions",      # or "anthropic-messages"
    thinking="medium",                       # off|minimal|low|medium|high
    network=None,                            # or a docker network name
)

The DTAP SecurityClaim/Task configures it per run via set_config (handled by the base): active_mcp_servers, env_injection_config, system_prompt, user_prompt, task_dir, available_injections, threat_model, max_turns, native_tools_policy. The model and generation settings are construction concerns, never config slots. Wrap it in a TargetFactory for the Controller.

The Docker image

docker/Dockerfile builds the runtime image (node:24-bookworm-slim + a pinned openclaw), with docker/run_turns.mjs as the entrypoint that reads /state/task.json and runs the turns. Build and push it once (keep the tag in sync with driver.DEFAULT_IMAGE):

docker build -t decodingtrustagent/dtap-openclaw:openclaw-2026.4 docker/

The DTAP env-server images (the MCP backends) are a separate, scaffold-level concern; this image is only the agent runtime.

Faithfulness

See ASSUMPTIONS.md for every deviation from upstream DTAP (AI-secure/DecodingTrust-Agent, commit e0323a52, Apache-2.0): the host-CLI -> container packaging, native tools enabled, the LiteLLM provider wiring, the single-host-proxy MCP convention, and the trajectory env/native split.

Testing

The offline suite mocks every Docker/agent boundary (no Node, OpenClaw, Docker, or network needed):

PYTHONPATH="src:../dtap_scaffold/src" python -m pytest tests -q

The real end-to-end test is marked @pytest.mark.docker @pytest.mark.live and is skipped unless a Docker daemon, the built image, and LiteLLM credentials (LITELLM_API_KEY / LITELLM_API_BASE) are all present.

Credits / upstream

This module's own code is MIT-licensed (Copyright (c) 2026 Simon Sure; see LICENSE).

It is a faithful reimplementation of the OpenClaw agent adapter from the DecodingTrust-Agent Platform (DTAP) - AI-secure/DecodingTrust-Agent, pinned commit e0323a52, licensed Apache-2.0. We reimplement upstream's agent/openclaw/src/{agent.py,utils.py} config wiring, CLI invocation, and trajectory converter against the shared dtap_scaffold contracts; no upstream source is vendored. Every deviation from upstream (host-CLI -> container packaging, native exec/fs tools enabled, LiteLLM provider wiring, single-host-proxy MCP convention, env/native trajectory split) is documented in ASSUMPTIONS.md. See NOTICE for full attribution.

The OpenClaw CLI itself is installed from npm inside the Docker runtime image and invoked as a subprocess; it is not redistributed in this package. No DTAP dataset is bundled here (the DTAP tasks live in the separate DTAP security claim). If you report numbers produced with this module, cite the DTAP paper (arXiv:2605.04808).

Metadata

Release files for superred-target-dtap-openclaw 0.1.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 superred-target-dtap-openclaw 0.1.0
File Size Uploaded Provenance
superred_target_dtap_openclaw-0.1.0.tar.gz 42.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for superred-target-dtap-openclaw 0.1.0
File Interpreter ABI Platform
superred_target_dtap_openclaw-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 69.2 kB

Release files / superred_target_dtap_openclaw-0.1.0.tar.gz

Download URL superred_target_dtap_openclaw-0.1.0.tar.gz
Size 42.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ea9af7c6cb6e1a62df983dc7df352732eb81b11650a9bc205110a657fa0358f1
BLAKE2b-256 checksum
How to use checksums
537c70537370b085fb85e45e6bbca82c2eb105ba72228747c53197b09bbf77bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 22, 2026.

Transparency log

Release files / superred_target_dtap_openclaw-0.1.0-py3-none-any.whl

Download URL superred_target_dtap_openclaw-0.1.0-py3-none-any.whl
Size 26.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4af9e8ea89d09d550d807bfc8c7fc003e426456a22c7a04d5d7ec9333fae0d5b
BLAKE2b-256 checksum
How to use checksums
916175f1238e9327b6e454da8f54ff28b4edd1e2aa11a7faacd4e72212dc3b86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 22, 2026.

Transparency log

Security for superred-target-dtap-openclaw 0.1.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for superred_target_dtap_openclaw-0.1.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 Jul 22, 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.1.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