Initial MVP: AI Agent Permission Guard — sandbox and audit AI agent actions with configurable policies
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "default",
|
||||
"version": "1.0.0",
|
||||
"description": "Default policy — allows common development operations with restrictions.",
|
||||
"defaultPermission": "deny",
|
||||
"filesystem": [
|
||||
{
|
||||
"path": "./**",
|
||||
"operations": ["read", "write", "append"],
|
||||
"permission": "allow"
|
||||
},
|
||||
{
|
||||
"path": "/tmp/**",
|
||||
"operations": ["read", "write", "append", "delete"],
|
||||
"permission": "allow"
|
||||
},
|
||||
{
|
||||
"path": "/etc/**",
|
||||
"operations": ["read"],
|
||||
"permission": "allow"
|
||||
}
|
||||
],
|
||||
"network": [
|
||||
{
|
||||
"host": "*.npmjs.org",
|
||||
"protocols": ["https"],
|
||||
"permission": "allow"
|
||||
},
|
||||
{
|
||||
"host": "registry.npmjs.org",
|
||||
"protocols": ["https"],
|
||||
"permission": "allow"
|
||||
},
|
||||
{
|
||||
"host": "github.com",
|
||||
"protocols": ["https"],
|
||||
"permission": "allow"
|
||||
},
|
||||
{
|
||||
"host": "api.github.com",
|
||||
"protocols": ["https"],
|
||||
"permission": "allow"
|
||||
}
|
||||
],
|
||||
"exec": [
|
||||
{
|
||||
"command": "node",
|
||||
"permission": "allow"
|
||||
},
|
||||
{
|
||||
"command": "npm",
|
||||
"permission": "allow"
|
||||
},
|
||||
{
|
||||
"command": "git",
|
||||
"permission": "allow"
|
||||
},
|
||||
{
|
||||
"command": "tsc",
|
||||
"permission": "allow"
|
||||
}
|
||||
],
|
||||
"envAllowlist": ["NODE_ENV", "PATH", "HOME", "USER", "SHELL", "TMPDIR", "PWD"],
|
||||
"auditLogPath": "./audit.log"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "readonly",
|
||||
"version": "1.0.0",
|
||||
"description": "Read-only policy — allows reading from project directory, blocks all writes, network, and exec.",
|
||||
"defaultPermission": "deny",
|
||||
"filesystem": [
|
||||
{
|
||||
"path": "./**",
|
||||
"operations": ["read"],
|
||||
"permission": "allow"
|
||||
},
|
||||
{
|
||||
"path": "/tmp/**",
|
||||
"operations": ["read", "write"],
|
||||
"permission": "allow"
|
||||
}
|
||||
],
|
||||
"network": [],
|
||||
"exec": [],
|
||||
"envAllowlist": ["NODE_ENV", "PATH", "HOME"],
|
||||
"auditLogPath": "./audit.log"
|
||||
}
|
||||
Reference in New Issue
Block a user