Update openenv.yaml
Browse files- openenv.yaml +8 -121
openenv.yaml
CHANGED
|
@@ -7,17 +7,14 @@ name: email-gatekeeper
|
|
| 7 |
version: "1.0.0"
|
| 8 |
description: >
|
| 9 |
Intelligent Email Gatekeeper β a Gymnasium-based Reinforcement Learning
|
| 10 |
-
environment
|
| 11 |
-
predicting three dimensions: Urgency Category, Department Routing,
|
| 12 |
-
and Resolution Action. Covers 32 scenarios across spam detection,
|
| 13 |
-
support routing, and phishing/security threat identification.
|
| 14 |
-
|
| 15 |
author: zerogravity
|
| 16 |
license: MIT
|
| 17 |
framework: gymnasium
|
| 18 |
python_requires: ">=3.10"
|
| 19 |
|
| 20 |
# ββ Entry point βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 21 |
entry_point: "env:EmailTriageEnv"
|
| 22 |
|
| 23 |
# ββ Observation space βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -27,150 +24,40 @@ observation_space:
|
|
| 27 |
dtype: float32
|
| 28 |
low: 0.0
|
| 29 |
high: 1.0
|
| 30 |
-
description: >
|
| 31 |
-
Flat vector of 32 floats encoding:
|
| 32 |
-
[0:24] Binary keyword flags (24 vocab words)
|
| 33 |
-
[24:27] One-hot sentiment (positive / neutral / negative)
|
| 34 |
-
[27:32] One-hot context (spam / billing / tech / security / legal)
|
| 35 |
|
| 36 |
# ββ Action space ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 37 |
action_space:
|
| 38 |
type: MultiDiscrete
|
| 39 |
nvec: [3, 3, 3]
|
| 40 |
-
dimensions:
|
| 41 |
-
- name: urgency
|
| 42 |
-
index: 0
|
| 43 |
-
values:
|
| 44 |
-
0: General
|
| 45 |
-
1: Billing
|
| 46 |
-
2: Security Breach
|
| 47 |
-
- name: routing
|
| 48 |
-
index: 1
|
| 49 |
-
values:
|
| 50 |
-
0: AI Auto-Reply
|
| 51 |
-
1: Tech Support
|
| 52 |
-
2: Legal
|
| 53 |
-
- name: resolution
|
| 54 |
-
index: 2
|
| 55 |
-
values:
|
| 56 |
-
0: Archive
|
| 57 |
-
1: Draft Reply
|
| 58 |
-
2: Escalate
|
| 59 |
-
|
| 60 |
-
# ββ Reward function βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 61 |
-
reward:
|
| 62 |
-
description: >
|
| 63 |
-
Strict penalty-based reward. Security breach misses are penalised
|
| 64 |
-
at 4x the magnitude of a correct answer to reflect real-world risk.
|
| 65 |
-
rules:
|
| 66 |
-
- condition: "correct urgency=2 but predicted urgency != 2"
|
| 67 |
-
reward: -2.0
|
| 68 |
-
label: SECURITY_MISS
|
| 69 |
-
- condition: "all three dimensions exactly correct"
|
| 70 |
-
reward: +1.0
|
| 71 |
-
label: EXACT
|
| 72 |
-
- condition: "urgency correct, exactly one other dimension wrong"
|
| 73 |
-
reward: +0.2
|
| 74 |
-
label: PARTIAL_1
|
| 75 |
-
- condition: "urgency correct, both other dimensions wrong"
|
| 76 |
-
reward: +0.1
|
| 77 |
-
label: PARTIAL_2
|
| 78 |
-
- condition: "urgency wrong on non-security email"
|
| 79 |
-
reward: 0.0
|
| 80 |
-
label: WRONG
|
| 81 |
-
normalisation: >
|
| 82 |
-
Each raw reward is divided by (num_emails * 1.0) so the ideal
|
| 83 |
-
cumulative episode score = 1.0
|
| 84 |
|
| 85 |
# ββ Tasks βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 86 |
tasks:
|
| 87 |
-
|
| 88 |
- id: easy
|
| 89 |
-
name: "Task 1 β Spam vs Real Email Detection"
|
| 90 |
difficulty: easy
|
| 91 |
-
description: >
|
| 92 |
-
Agent must distinguish promotional spam from legitimate emails
|
| 93 |
-
and assign correct General/Billing urgency with appropriate routing.
|
| 94 |
num_emails: 4
|
| 95 |
-
email_types:
|
| 96 |
-
- Spam promotional
|
| 97 |
-
- Spam lottery
|
| 98 |
-
- Routine tech support
|
| 99 |
-
- General billing inquiry
|
| 100 |
target_score: 1.0
|
| 101 |
-
baseline_score: 1.0
|
| 102 |
-
success_threshold: 0.8
|
| 103 |
-
|
| 104 |
- id: medium
|
| 105 |
-
name: "Task 2 β Support Routing & Passive-Aggressive Legal Threats"
|
| 106 |
difficulty: medium
|
| 107 |
-
description: >
|
| 108 |
-
Agent must correctly route billing disputes, tech issues, and
|
| 109 |
-
passive-aggressive legal threats that use polite language to
|
| 110 |
-
disguise escalation intent.
|
| 111 |
num_emails: 8
|
| 112 |
-
email_types:
|
| 113 |
-
- Overdue invoice complaint
|
| 114 |
-
- Refund dispute
|
| 115 |
-
- App crash report
|
| 116 |
-
- Persistent login bug
|
| 117 |
-
- Polite legal ultimatum
|
| 118 |
-
- Attorney CC warning
|
| 119 |
-
- Regulatory complaint
|
| 120 |
-
- SLA breach legal notice
|
| 121 |
target_score: 1.0
|
| 122 |
-
baseline_score: 0.95
|
| 123 |
-
success_threshold: 0.75
|
| 124 |
-
|
| 125 |
- id: hard
|
| 126 |
-
name: "Task 3 β Phishing Detection & Security Threat Classification"
|
| 127 |
difficulty: hard
|
| 128 |
-
description: >
|
| 129 |
-
Agent must identify subtle phishing attempts disguised as IT notices,
|
| 130 |
-
HR emails, and vendor requests, plus classify ransomware and extortion
|
| 131 |
-
threats that combine security and legal signals.
|
| 132 |
num_emails: 16
|
| 133 |
-
email_types:
|
| 134 |
-
- IT audit phishing
|
| 135 |
-
- Fake invoice portal redirect
|
| 136 |
-
- HR credential capture
|
| 137 |
-
- Fake account suspension
|
| 138 |
-
- Business Email Compromise (BEC)
|
| 139 |
-
- Sign-in alert phishing
|
| 140 |
-
- Payroll migration phish
|
| 141 |
-
- License renewal BEC
|
| 142 |
-
- GDPR phishing with legal overlay
|
| 143 |
-
- Ransomware disguised as audit
|
| 144 |
-
- Data extortion threat
|
| 145 |
-
- Fake law firm letter
|
| 146 |
-
- Account hacked urgent
|
| 147 |
-
- Data breach notification
|
| 148 |
-
- Legal lawsuit threat
|
| 149 |
-
- Ransomware extortion
|
| 150 |
target_score: 1.0
|
| 151 |
-
baseline_score: 0.90
|
| 152 |
-
success_threshold: 0.70
|
| 153 |
-
|
| 154 |
-
# ββ Environment parameters ββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 155 |
-
parameters:
|
| 156 |
-
shuffle:
|
| 157 |
-
type: bool
|
| 158 |
-
default: true
|
| 159 |
-
description: Shuffle email order on each reset for training variety
|
| 160 |
-
task:
|
| 161 |
-
type: str
|
| 162 |
-
default: all
|
| 163 |
-
choices: [easy, medium, hard, all]
|
| 164 |
-
description: Which difficulty subset to load
|
| 165 |
|
| 166 |
# ββ Dependencies ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 167 |
dependencies:
|
| 168 |
- gymnasium>=0.29.0
|
| 169 |
- numpy>=1.24.0
|
| 170 |
- pydantic>=2.0.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
|
| 172 |
# ββ Reproducibility βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 173 |
reproducibility:
|
| 174 |
seed: 42
|
| 175 |
deterministic: true
|
| 176 |
-
baseline_script: inference.py
|
|
|
|
| 7 |
version: "1.0.0"
|
| 8 |
description: >
|
| 9 |
Intelligent Email Gatekeeper β a Gymnasium-based Reinforcement Learning
|
| 10 |
+
environment for triage.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
author: zerogravity
|
| 12 |
license: MIT
|
| 13 |
framework: gymnasium
|
| 14 |
python_requires: ">=3.10"
|
| 15 |
|
| 16 |
# ββ Entry point βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 17 |
+
# Dhyan dein: 'env' aapki file ka naam hai aur 'EmailTriageEnv' class ka
|
| 18 |
entry_point: "env:EmailTriageEnv"
|
| 19 |
|
| 20 |
# ββ Observation space βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 24 |
dtype: float32
|
| 25 |
low: 0.0
|
| 26 |
high: 1.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
# ββ Action space ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 29 |
action_space:
|
| 30 |
type: MultiDiscrete
|
| 31 |
nvec: [3, 3, 3]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
# ββ Tasks βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 34 |
tasks:
|
|
|
|
| 35 |
- id: easy
|
|
|
|
| 36 |
difficulty: easy
|
|
|
|
|
|
|
|
|
|
| 37 |
num_emails: 4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
target_score: 1.0
|
|
|
|
|
|
|
|
|
|
| 39 |
- id: medium
|
|
|
|
| 40 |
difficulty: medium
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
num_emails: 8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
target_score: 1.0
|
|
|
|
|
|
|
|
|
|
| 43 |
- id: hard
|
|
|
|
| 44 |
difficulty: hard
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
num_emails: 16
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
target_score: 1.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
# ββ Dependencies ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 49 |
+
# Inka hona zaroori hai taaki validator ko pata chale kya install karna hai
|
| 50 |
dependencies:
|
| 51 |
- gymnasium>=0.29.0
|
| 52 |
- numpy>=1.24.0
|
| 53 |
- pydantic>=2.0.0
|
| 54 |
+
- fastapi
|
| 55 |
+
- uvicorn
|
| 56 |
+
- gradio
|
| 57 |
+
- pyyaml
|
| 58 |
|
| 59 |
# ββ Reproducibility βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 60 |
reproducibility:
|
| 61 |
seed: 42
|
| 62 |
deterministic: true
|
| 63 |
+
baseline_script: inference.py
|