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).

Download files

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

Source Distribution

superred_target_dtap_openclaw-0.1.0.tar.gz (42.5 kB view details)

Uploaded Source

Built Distribution

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

superred_target_dtap_openclaw-0.1.0-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for superred_target_dtap_openclaw-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ea9af7c6cb6e1a62df983dc7df352732eb81b11650a9bc205110a657fa0358f1
MD5 b2e0f69744356fe287c1f0b743e99738
BLAKE2b-256 537c70537370b085fb85e45e6bbca82c2eb105ba72228747c53197b09bbf77bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for superred_target_dtap_openclaw-0.1.0.tar.gz:

Publisher: release.yml on RoldSI/superred-modules

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for superred_target_dtap_openclaw-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4af9e8ea89d09d550d807bfc8c7fc003e426456a22c7a04d5d7ec9333fae0d5b
MD5 1aa4d9b6a74b1cdd7360c54f6e92bc48
BLAKE2b-256 916175f1238e9327b6e454da8f54ff28b4edd1e2aa11a7faacd4e72212dc3b86

See more details on using hashes here.

Provenance

The following attestation bundles were made for superred_target_dtap_openclaw-0.1.0-py3-none-any.whl:

Publisher: release.yml on RoldSI/superred-modules

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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