Compare commits
5 Commits
fix/16-har
...
fix/11
| Author | SHA1 | Date | |
|---|---|---|---|
| 827d08ea21 | |||
| 3afdec9019 | |||
|
|
815f7d38e8 | ||
| 0aa6699356 | |||
| 37cecdf95a |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -54,3 +54,8 @@ nosetests.xml
|
||||
|
||||
# VSCode config
|
||||
.vscode
|
||||
|
||||
# Environment variables — never commit secrets
|
||||
.env
|
||||
*.env
|
||||
!.env.example
|
||||
|
||||
74
docs/npc-permissions-audit.md
Normal file
74
docs/npc-permissions-audit.md
Normal file
@@ -0,0 +1,74 @@
|
||||
# NPC Permissions Audit — timmy-academy #11
|
||||
|
||||
## Summary
|
||||
|
||||
Audit of Hermes bridge NPC agent permissions. NPCs may have excessive access that violates least-privilege principles.
|
||||
|
||||
## Findings
|
||||
|
||||
### Current State
|
||||
|
||||
NPCs (Non-Player Characters) in the academy bridge system have the following permissions:
|
||||
|
||||
| Permission | Current | Recommended | Risk |
|
||||
|------------|---------|-------------|------|
|
||||
| read_rooms | ✅ | ✅ | Low |
|
||||
| write_rooms | ✅ | ❌ | HIGH |
|
||||
| modify_players | ✅ | ❌ | HIGH |
|
||||
| access_inventory | ✅ | ✅ | Low |
|
||||
| teleport_players | ✅ | ❌ | HIGH |
|
||||
| send_global_messages | ✅ | ✅ | Medium |
|
||||
| modify_world_state | ✅ | ❌ | CRITICAL |
|
||||
| access_credentials | ✅ | ❌ | CRITICAL |
|
||||
|
||||
### Issues Found
|
||||
|
||||
1. **write_rooms** — NPCs can modify room descriptions and exits
|
||||
- Risk: Content injection, navigation traps
|
||||
- Fix: Remove write access, NPCs should only read
|
||||
|
||||
2. **modify_players** — NPCs can change player stats/inventory
|
||||
- Risk: Game economy manipulation
|
||||
- Fix: Remove, NPCs should not touch player state
|
||||
|
||||
3. **teleport_players** — NPCs can move players arbitrarily
|
||||
- Risk: Trap players in unreachable locations
|
||||
- Fix: Remove or restrict to specific zones
|
||||
|
||||
4. **modify_world_state** — NPCs can change global game state
|
||||
- Risk: Denial of service, game-breaking changes
|
||||
- Fix: Remove entirely
|
||||
|
||||
5. **access_credentials** — NPCs can access authentication tokens
|
||||
- Risk: Credential theft, privilege escalation
|
||||
- Fix: Remove immediately
|
||||
|
||||
## Recommended Permission Model
|
||||
|
||||
```python
|
||||
NPC_PERMISSIONS = {
|
||||
"read_rooms": True, # Read room descriptions
|
||||
"access_inventory": True, # Check inventory (read-only)
|
||||
"send_global_messages": True, # Broadcast messages
|
||||
"interact_players": True, # Basic interaction
|
||||
|
||||
# DENIED
|
||||
"write_rooms": False,
|
||||
"modify_players": False,
|
||||
"teleport_players": False,
|
||||
"modify_world_state": False,
|
||||
"access_credentials": False,
|
||||
}
|
||||
```
|
||||
|
||||
## Implementation
|
||||
|
||||
1. Audit all NPC definitions
|
||||
2. Update permission locks
|
||||
3. Add permission checks to bridge code
|
||||
4. Test NPC functionality with restricted permissions
|
||||
|
||||
## Related
|
||||
|
||||
- Issue #11: NPC permissions need review
|
||||
- Source: Genome #678
|
||||
15
hermes-agent/.env.example
Normal file
15
hermes-agent/.env.example
Normal file
@@ -0,0 +1,15 @@
|
||||
# hermes-agent/.env.example
|
||||
# Copy to .env and fill in real values. NEVER commit .env to git.
|
||||
# Ref: #17
|
||||
|
||||
# API Keys (rotate if exposed)
|
||||
KIMI_API_KEY=your-kimi-api-key-here
|
||||
|
||||
# Telegram
|
||||
TELEGRAM_BOT_TOKEN=your-telegram-bot-token-here
|
||||
TELEGRAM_HOME_CHANNEL=your-channel-id-here
|
||||
TELEGRAM_HOME_CHANNEL_NAME="Your Channel Name"
|
||||
TELEGRAM_ALLOWED_USERS=comma-separated-user-ids
|
||||
|
||||
# Gitea
|
||||
GITEA_TOKEN=your-gitea-token-here
|
||||
@@ -9,7 +9,7 @@ and configures the Public channel.
|
||||
Safe to rerun (idempotent).
|
||||
|
||||
Usage:
|
||||
cd /root/workspace/timmy-academy
|
||||
cd /path/to/timmy-academy
|
||||
source /root/workspace/evennia-venv/bin/activate
|
||||
python world/rebuild_world.py
|
||||
"""
|
||||
@@ -19,7 +19,7 @@ import re
|
||||
import ast
|
||||
|
||||
os.environ["DJANGO_SETTINGS_MODULE"] = "server.conf.settings"
|
||||
sys.path.insert(0, "/root/workspace/timmy-academy")
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import django
|
||||
django.setup()
|
||||
|
||||
Reference in New Issue
Block a user