Skip to main content
Loading navigation
Back to prompt library

Initialize Claude Agents SDK Containment Harness

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

Prompt source

implementation11 lines3 sectionsNo variables0 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])