File size: 1,410 Bytes
d8dd1c8
d03f57f
 
 
 
 
d8dd1c8
d03f57f
d8dd1c8
 
d03f57f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
tags: [openenv]
title: PII-Scrub-Assistant-v1
emoji: "\U0001f512"
colorFrom: indigo
colorTo: purple
sdk: docker
app_port: 7860
---

# PII-Scrub-Assistant-v1

> **Meta OpenEnv 2026 Sync Protocol** -- PII redaction environment.

## Tasks

| Task | Difficulty | Goal | Grader |
|------|-----------|------|--------|
| task_1 | Easy | Redact phone number | 1.0 if phone gone |
| task_2 | Medium | Redact Name + Email | 1.0 if both absent |
| task_3 | Hard | Redact PII, keep Order/System IDs | 1.0 if PII gone AND IDs kept |

## Reward Function

$$R = \\sum_{i=1}^{N} 0.5 \\cdot \\mathbb{1}[\\text{PII}_i \\text{ redacted}] - 0.2 \\cdot N_{\\text{over}} - 1.0 \\cdot \\mathbb{1}[\\text{structural damage}]$$

| Component | Signal |
|-----------|--------|
| Correct redaction | $+0.5$ per PII type |
| Over-redaction | $-0.2$ per extra tag |
| Structural damage | $-1.0$ |
| Order ID penalty | $-0.3$ (task 3) |

## API

- `POST /reset` -- `{"player_id": "...", "session_id": "...", "task_id": "task_1"}`
- `POST /step`  -- `{"player_id": "...", "session_id": "...", "action": {"action_id": 1, "redacted_text": "..."}}`
- `GET  /state` -- current snapshot
- `GET  /health` -- liveness

## Quick Start

```bash
pip install -r requirements.txt
uvicorn app:app --host 0.0.0.0 --port 7860
python baseline_inference.py
```

## Docker

```bash
docker build -t pii-scrub-env .
docker run -p 7860:7860 pii-scrub-env
```