Skip to main content
Back to Prompt Library
implementation

Initialize Claude Agents SDK Containment Harness

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Claude Agents SDK Model Hardware Standard Device Enclosure & Inspector

Format
Code-aware
Lines
11
Sections
3
Linked challenge
Claude Agents SDK Model Hardware Standard Device Enclosure & Inspector

Prompt source

Original prompt text with formatting preserved for inspection.

11 lines
3 sections
No variables
0 checklist items
from claude_agents import Agent, tool

# Define MHS isolated tool wrapper
@tool
def mhs_write_actuator_bus(device_id: str, command: str, value: float) -> str:
    """MHS Hardware interaction tool with pre-execution safety hook."""
    # Insert pre-execution validation hook
    if value > 24.0:
        raise ValueError("MHS Containment Violation: Value exceeds safe envelope!")
    return f"Device {device_id} command {command} executed safely."

# Instantiate Claude Agent with containment tools
agent = Agent(tools=[mhs_write_actuator_bus])

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.