Vote for your favorite SkillMD. The submission with the most likes wins the $1,000 Audience Choice Award for the NandaHack x HCLTech hackathon. Voting is open through September 25.Vote now →
in reviewhumanPR #65Privacy

RoboAgent Guard for Safety and Privacy Validation

RoboAgent Guard targets NandaHack Phase 1 Problem 09: privacy.

Author

subhashchandra001 avatar

@subhashchandra001

github profile →
Status
In review
Opened on
Jul 4
Branch
hackathon/subhash-roboagent-guard

Description

The pitch.

## Summary [Updated]

RoboAgent Guard targets **NandaHack Phase 1 Problem 09: privacy**.

It adds a deterministic `privacy: sensor_redaction` plugin for robot-agent sensor traces, plus a `roboagent_guard` scenario and adversarial validators. The scenario demonstrates that the reference `privacy: noop` plugin leaks raw sensor payloads and fails validation, while `privacy: sensor_redaction` redacts sensitive sensor terms and passes.

## Motivation

Robot-agent traces may contain privacy-sensitive observations such as `raw_camera`, `camera_frame`, `lidar_scan`, `person_detected`, `private_zone`, and `map_save`.

A privacy layer should prevent those raw sensor terms from being shared directly in the trace. This PR adds a narrow, deterministic sensor-redaction privacy plugin that is different from the already merged hybrid encryption work: it focuses on auditable robot-sensor redaction policy, not general-purpose encryption.

## Changes

  - Adds `SensorRedactionPrivacy` as `privacy: sensor_redaction`.
  - Registers the plugin in the built-in plugin registry and entry points.
  - Adds the `roboagent_guard` scenario factory.
  - Adds runnable scenario YAML at `scenarios/roboagent_guard.yaml`.
  - Adds adversarial validators for:
    - robot command safety markers
    - prior supervisor approval before robot commands
    - privacy filtering on sensitive sensor messages
  - Updates validator matching to use exact tokens instead of substring matching.
  - Adds adversarial tests for:
    - `unsafe_action`
    - `not_supervisor_approved`
    - `risk_checked_skipped`
    - self-attested supervisor approval
    - `privacy: noop` leaking raw sensor payloads
  - Adds documentation at `docs/hackathon/roboagent-guard.md`.
  - Updates privacy-layer docs with `sensor_redaction`.

## Adversarial Path

The reference plugin fails:

  ```yaml
  privacy: noop

With noop, raw sensor terms such as raw_camera, person_detected, and private_zone remain in the trace without privacy markers, so the RoboAgent Guard privacy validator fails.

The new plugin passes:

  privacy: sensor_redaction

With sensor_redaction, sensitive sensor tokens are replaced with redaction markers and stamped with privacy_filtered=<action_id>, no_raw_storage, and redacted.

## Verification

Branch is cleanly based on latest upstream/main with one RoboAgent Guard commit.

  make ci-local

Result:

1298 passed, 1 skipped, 1 deselected, 1 warning
ci-local: all 5 checks passed

Focused checks also pass:

uv run pytest packages/nest-core/tests/test_validators.py::TestRoboAgentGuard packages/nest-core/tests/test_scenarios.py::TestRoboAgentGuardScenario packages/nest-plugins-reference/tests/test_sensor_redaction.py -q

Result:

  16 passed

## Scope

This PR is limited to Problem 09 privacy: deterministic robot-sensor redaction, the paired scenario, adversarial validators, docs, and tests.

Try it

Open PR on GitHubView diff

Checkout locally

git fetch origin pull/65/head:pr-65
git checkout pr-65