Spaces:
Runtime error
Runtime error
File size: 4,501 Bytes
235c3c9 9110548 4431575 9110548 52b9084 9110548 4431575 9110548 4431575 0f55283 4431575 9110548 4431575 0f55283 4431575 0f55283 52b9084 0f55283 9110548 4431575 0f55283 4431575 9110548 0f55283 9110548 4431575 9110548 4431575 0f55283 4431575 9110548 4431575 9110548 4431575 9110548 52b9084 4431575 0f55283 4431575 9110548 4431575 0f55283 52b9084 4431575 0f55283 52b9084 0f55283 52b9084 0f55283 4431575 9110548 4431575 0f55283 52b9084 9110548 52b9084 9110548 4431575 0f55283 9110548 4431575 0f55283 9110548 0f55283 4431575 9110548 0f55283 9110548 0f55283 9110548 0f55283 9110548 0f55283 4431575 9110548 52b9084 9110548 0f55283 9110548 52b9084 0f55283 52b9084 0f55283 52b9084 0f55283 9110548 52b9084 9110548 52b9084 9110548 52b9084 9110548 52b9084 9110548 54a7970 52b9084 54a7970 52b9084 9110548 52b9084 9110548 52b9084 9110548 | 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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | ---
title: AI Deception OpenEnv
emoji: π‘οΈ
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860
pinned: false
---
# π‘οΈ AI Cyber Deception OpenEnv
## Overview
AI Cyber Deception OpenEnv is a real-world cybersecurity simulation environment where an AI agent learns to detect, deceive, and mitigate cyber attacks.
This environment simulates production-like cybersecurity defense scenarios including brute force attacks, port scanning, SQL injection, directory traversal, and credential stuffing.
The environment follows the **OpenEnv specification** and supports:
- `reset()`
- `step()`
- `state()`
---
## π― Real-World Task
Simulate cybersecurity defense in a production-like environment:
- Detect brute force attacks
- Detect port scanning
- Detect SQL injection
- Detect directory traversal
- Deploy deception mechanisms
- Block malicious attackers
---
## βοΈ Action Space
The AI agent can perform the following actions:
- `detect_attack`
- `deploy_honeypot`
- `fake_database`
- `block_ip`
---
## ποΈ Observation Space
Environment returns structured observation:
- `failed_logins`
- `port_scans`
- `suspicious_ips`
- `total_requests`
- `attack_types`
---
## π§ Tasks
### Easy Task
Detect cyber attack
Goal:
- Detect suspicious activity
- Identify attack patterns
---
### Medium Task
Detect attack and deploy deception
Goal:
- Detect cyber attack
- Deploy honeypot or fake database
---
### Hard Task
Full cyber defense workflow
Goal:
- Detect attack
- Deploy deception
- Block attacker
---
## π Reward Function
| Action | Reward |
|--------|--------|
| detect_attack | 0.15β0.45 |
| deploy_honeypot | 0.30 |
| fake_database | 0.20 |
| block_ip (correct) | 0.70 |
| early block | 0.05 |
Reward range normalized between **0.0 β 1.0**
---
## π API Endpoints
Available endpoints:
- `/reset`
- `/step`
- `/state`
- `/logs`
- `/status`
Example:
POST /reset
POST /step
GET /state
---
## π Run Locally
Install dependencies:
```bash
pip install -r requirements.txt
Run inference:
python inference.py
π³ Docker
Build:
docker build -t ai-deception .
Run:
docker run -p 7860:7860 ai-deception
π€ Hugging Face Deployment
Live Space:
https://bytecore1-ai-deception-openenv.hf.space/
Endpoints:
https://bytecore1-ai-deception-openenv.hf.space/reset
https://bytecore1-ai-deception-openenv.hf.space/state
https://bytecore1-ai-deception-openenv.hf.space/status
https://bytecore1-ai-deception-openenv.hf.space/logs
π Baseline Results
Example run:
[START] task=easy env=ai-deception-openenv model=Qwen
[STEP] step=1 action=detect_attack reward=0.45 done=false error=null
[STEP] step=2 action=deploy_honeypot reward=0.30 done=false error=null
[STEP] step=3 action=block_ip reward=0.70 done=true error=null
[END] success=true steps=3 score=0.48 rewards=0.45,0.30,0.70
ποΈ Architecture
Attacker
β
Fake Server
β
AI Agent (Inference)
β
Defense Actions
β
Reward
π¦ Project Structure
ai-deception-openenv/
β
βββ env/
β βββ __init__.py
β βββ attacker.py
β βββ deception.py
β βββ env.py
β βββ fake_server.py
β βββ test_env.py
β βββ test_server.py
β
βββ tasks/
β βββ __init__.py
β β
β βββ easy/
β β βββ __init__.py
β β βββ task.py
β β βββ grader.py
β β
β βββ medium/
β β βββ __init__.py
β β βββ task.py
β β βββ grader.py
β β
β βββ hard/
β β βββ __init__.py
β β βββ task.py
β β βββ grader.py
β β
β βββ test_tasks.py
β
βββ server/
β βββ app.py
β
βββ inference.py
βββ app.py
βββ models.py
βββ openenv.yaml
βββ Dockerfile
βββ requirements.txt
βββ pyproject.toml
βββ uv.lock
βββ README.md
βββ LICENSE
βββ .gitignore
βββ .gitattributes
β
OpenEnv Compliance
reset() implemented
step() implemented
state() implemented
Docker support
Structured logs
Multiple tasks
Reward normalization
π¨βπ» Use Case
This environment can be used for:
Cybersecurity research
Reinforcement learning
AI defense strategy training
Red team vs blue team simulations
π‘οΈ AI Cyber Deception
This project demonstrates how AI can:
Detect attackers
Deploy deception
Block malicious actors
Learn defensive strategies
License
MIT License
|