Safety Gates

Hard safety constraints that protect your system

Overview

ATA includes three mandatory safety gates that cannot be bypassed. If any gate fails, the action is vetoed regardless of its score.

Critical: Safety gates are the last line of defense. Your application MUST handle override responses appropriately.

Gate Types

GateParameterOverride CodePriority
Safetysafety_ok2Highest
Missionmission_ok3Medium
Ethicsethics_ok4Lower

How They Work

Gates are evaluated in priority order. The first failing gate determines the override reason:

if not safety_ok:
    return override(reason_code=2, "Safety veto")
elif not mission_ok:
    return override(reason_code=3, "Mission veto")
elif not ethics_ok:
    return override(reason_code=4, "Ethics veto")

Handling Overrides

result = ata.decide(actions=[0, 1, 2], safety_ok=check_safety())

if result.is_success:
    execute_action(result.action_id)
elif result.is_safety_override:
    # Safety critical - immediate stop
    trigger_emergency_stop()
elif result.is_mission_override:
    # Mission constraint - may continue safely
    log_mission_violation()
elif result.is_ethics_override:
    # Ethics constraint
    request_human_review()

Best Practices