一键导入
wopr-security
WOPR security configuration reference covering trust levels, capabilities, sandbox isolation, access patterns, and session security.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
WOPR security configuration reference covering trust levels, capabilities, sandbox isolation, access patterns, and session security.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Installation, configuration, and deployment guide for WOPR - the self-sovereign AI session management system.
Comprehensive P2P networking plugin for WOPR using Hyperswarm, identity management, topic-based discovery, and secure peer communication
Complete WOPR CLI reference for session management, skills, plugins, providers, middleware, cron jobs, security, and sandbox isolation.
| name | wopr-security |
| description | WOPR security configuration reference covering trust levels, capabilities, sandbox isolation, access patterns, and session security. |
WOPR implements a three-layer security model: Trust Levels (who), Capabilities (what), and Sandbox (where). This skill covers security configuration and best practices.
Trust levels determine the base security context for any injection source.
| Level | Source | Default Behavior |
|---|---|---|
owner | CLI, daemon, cron, internal | Full access to all capabilities |
trusted | Plugins, verified users | Scoped access per configuration |
semi-trusted | API, gateway forwarded | Limited tools, optional sandbox |
untrusted | P2P discovery, unknown sources | Sandboxed, minimal tools |
owner (100) > trusted (75) > semi-trusted (50) > untrusted (0)
Higher trust levels can grant capabilities to lower levels. Lower trust levels cannot escalate their own privileges.
Capabilities control what actions a session or agent can perform.
| Capability | Description |
|---|---|
inject | Send messages to sessions |
inject.tools | Use A2A tools during execution |
inject.network | Make HTTP requests (http_fetch) |
inject.exec | Execute shell commands (exec_command) |
session.spawn | Create new sessions |
session.history | Read own session history |
cross.inject | Inject messages into other sessions |
cross.read | Read other sessions' history |
config.read | Read configuration |
config.write | Modify WOPR configuration |
memory.read | Read memory files |
memory.write | Write memory files |
cron.manage | Create/delete cron jobs |
event.emit | Emit events |
a2a.call | Use agent-to-agent communication tools |
* | Wildcard - all capabilities |
// Owner: Full access
owner: ["*"]
// Trusted: Operational access
trusted: ["inject", "inject.tools", "session.spawn", "session.history",
"memory.read", "memory.write", "config.read", "event.emit", "a2a.call"]
// Semi-trusted: Limited interaction
"semi-trusted": ["inject", "inject.tools", "session.history",
"memory.read", "config.read", "a2a.call"]
// Untrusted: Message injection only (no tools)
untrusted: ["inject"]
// Gateway: Cross-session forwarding
gateway: ["inject", "inject.tools", "cross.inject", "cross.read",
"session.history", "memory.read", "a2a.call"]
# View security status
wopr security status
# Set enforcement mode
wopr security enforcement off # No enforcement (testing)
wopr security enforcement warn # Log violations but allow (migration)
wopr security enforcement enforce # Block violations (production)
# List all session configs
wopr security sessions
# View specific session config
wopr security session <name>
# Configure session properties
wopr security session <name> <property> <value>
Control who can inject into a session:
# Allow anyone
wopr security session gateway access "*"
# Only trusted and above
wopr security session main access "trust:trusted"
# Allow untrusted (for gateway sessions)
wopr security session public-api access "trust:untrusted"
# Specific P2P peer
wopr security session alice access "p2p:MCoxK8f2..."
Control which session transcripts THIS session can see in memory search:
# Can see all sessions' transcripts
wopr security session admin indexable "*"
# Can only see own transcripts
wopr security session p2p-peer indexable "self"
# Self plus specific pattern
wopr security session gateway indexable "self,session:api-.*"
Set what a session can do:
# Full capabilities
wopr security session main capabilities "*"
# Limited capabilities
wopr security session sandbox capabilities "inject,inject.tools,session.history"
| Pattern | Description |
|---|---|
* | Matches anyone |
trust:owner | Owner trust level only |
trust:trusted | Trusted or higher |
trust:semi-trusted | Semi-trusted or higher |
trust:untrusted | Any trust level |
session:<name> | From specific session |
p2p:<publicKey> | Specific P2P peer |
type:<sourceType> | By source type (cli, daemon, p2p, etc.) |
Untrusted sources can run in hardened Docker containers for isolation.
docker run \
--read-only \ # Read-only root filesystem
--tmpfs /tmp --tmpfs /var/tmp \ # Ephemeral temp dirs
--network none \ # No network (prevents exfiltration)
--cap-drop ALL \ # Drop all Linux capabilities
--security-opt no-new-privileges \ # Prevent privilege escalation
--pids-limit 100 \ # Limit process count
--memory 512m \ # Memory limit
--memory-swap 512m \ # No swap
--cpus 0.5 \ # CPU limit
--ulimit nofile=1024:1024 \ # File descriptor limits
wopr-sandbox:latest
| Trust Level | Enabled | Network | Memory | CPU | Timeout |
|---|---|---|---|---|---|
owner | No | host | - | - | - |
trusted | No | host | - | - | - |
semi-trusted | Yes | bridge | 512MB | 0.5 | 300s |
untrusted | Yes | none | 256MB | 0.25 | 60s |
wopr sandbox status # Show sandbox status
wopr sandbox list # List all containers
wopr sandbox create <session> # Create sandbox for session
wopr sandbox destroy <session> # Destroy sandbox
wopr sandbox exec <session> <cmd> # Execute in sandbox
wopr sandbox prune # Remove idle containers
wopr sandbox recreate <session> # Recreate with new config
# Show P2P security settings
wopr security p2p
# Set trust level for discovered peers
wopr security p2p discovery-trust untrusted
# Enable/disable auto-accept of peers
wopr security p2p auto-accept false
{
"p2p": {
"discoveryTrust": "untrusted",
"autoAccept": false,
"keyRotationGraceHours": 24,
"maxPayloadSize": 1048576
}
}
untrustedwopr security audit enable
wopr security audit disable
{
"audit": {
"enabled": true,
"logSuccess": false,
"logDenied": true
}
}
| Event Type | Description |
|---|---|
access_granted | Access was allowed |
access_denied | Access was blocked |
capability_check | Capability was checked |
sandbox_start | Sandbox container started |
sandbox_stop | Sandbox container stopped |
policy_violation | Security policy violated |
rate_limit_exceeded | Rate limit hit |
trust_elevation | Trust level elevated |
trust_revocation | Trust level revoked |
Each A2A tool requires specific capabilities:
| Tool | Required Capability |
|---|---|
sessions_list | session.history |
sessions_send | cross.inject |
sessions_history | session.history |
sessions_spawn | session.spawn |
config_get | config.read |
config_set | config.write |
memory_read | memory.read |
memory_write | memory.write |
memory_search | memory.read |
cron_schedule | cron.manage |
cron_list | cron.manage |
event_emit | event.emit |
http_fetch | inject.network |
exec_command | inject.exec |
security_whoami | inject (always allowed) |
security_check | inject (always allowed) |
Grant only the capabilities each session needs.
# Research agent: needs network, no exec
wopr security session researcher capabilities "inject,inject.tools,inject.network,session.history"
# Code executor: needs exec, no network
wopr security session executor capabilities "inject,inject.tools,inject.exec,session.history"
# Review agent: read-only, no tools
wopr security session reviewer capabilities "inject,session.history"
Use separate sessions for different trust levels.
# Create isolated sessions
wopr session create untrusted-handler "Handle untrusted requests"
wopr session create trusted-executor "Execute trusted operations"
Route all external input through gateway sessions.
# Create gateway session
wopr session create external-gateway "You validate and filter external requests"
# Allow untrusted access
wopr security session external-gateway access "trust:untrusted"
# Give gateway cross-inject capability
wopr security session external-gateway capabilities "inject,inject.tools,cross.inject,session.history"
Enable audit logging for security visibility.
wopr security audit enable
Use warn mode during migration to identify issues:
wopr security enforcement warn
# Monitor for violations
wopr security enforcement enforce # Enable when ready
| Mode | Behavior |
|---|---|
off | No security enforcement (development only) |
warn | Log violations but allow execution (migration) |
enforce | Block violations (production) |
Agents can query their security context:
// Query own security context
security_whoami()
// Returns: { trustLevel, capabilities, sandbox status }
// Check if action is allowed
security_check({ capability: "inject.network" })
// Returns: { allowed: true/false, reason: "..." }
{
"enforcement": "warn",
"defaults": {
"minTrustLevel": "semi-trusted",
"sandbox": { "enabled": false, "network": "host" },
"tools": { "deny": ["config.write"] },
"rateLimit": { "perMinute": 60, "perHour": 1000 }
},
"defaultAccess": ["trust:trusted"],
"p2p": {
"discoveryTrust": "untrusted",
"autoAccept": false,
"keyRotationGraceHours": 24,
"maxPayloadSize": 1048576
},
"audit": {
"enabled": true,
"logSuccess": false,
"logDenied": true
}
}
Before enabling enforcement mode, verify: