The Nova Coder permission system controls what tools and agents are allowed to do. It is built around Permission values, PermissionSet, PermissionChecker, and the PermissionsService kernel service.
Permission Values
from novacoder.permissions import Permission
Permission.READ_FILES
Permission.MODIFY_FILES
Permission.RUN_SHELL_COMMANDS
Permission.ACCESS_GIT
Permission.NETWORK_ACCESS
Permission.READ_MEMORY
Permission.WRITE_MEMORY
PermissionSet and PermissionChecker
A PermissionSet represents a collection of granted permissions. A PermissionChecker wraps it and can enforce a tool's required permissions.
from novacoder.permissions import Permission, PermissionChecker, PermissionSet
checker = PermissionChecker({Permission.READ_FILES, Permission.ACCESS_GIT})
checker.check(["read_files", "access_git"]) # True
# Or use PermissionSet directly
ps = PermissionSet()
ps.add(Permission.READ_FILES)
assert ps.has(Permission.READ_FILES)
PermissionsService
PermissionsService is a kernel service that builds the default PermissionChecker from ToolsConfig:
read_filesis always granted.modify_filesis always granted.access_gitis granted whentools.gitisTrue.run_shell_commandsis granted whentools.shellortools.pythonisTrue.read_memoryandwrite_memoryare always granted.
PermissionsService is registered in NovaApplication and runs before ToolService so the tool registry can resolve the checker at boot time.
Wiring with ToolRegistry
ToolRegistry accepts a permission_checker and require_approval flag. When a tool runs, the checker validates the tool's permissions list; the approval callback gates execution when require_approval is enabled.
from novacoder.permissions import Permission, PermissionChecker
from novacoder.tools.registry import ToolRegistry
from novacoder.tools.filesystem import ReadFileTool
checker = PermissionChecker({Permission.READ_FILES})
registry = ToolRegistry(permission_checker=checker)
registry.register(ReadFileTool())
result = registry.execute("read_file", path="main.py")
Wiring with ToolService and NovaApplication
PermissionsService is registered as a kernel service in NovaApplication and initialized before ToolService. ToolService resolves the PermissionsService from the container and passes permissions_service.checker() to ToolRegistry. This means every tool execution is checked against the permission set derived from tools.shell, tools.git, tools.python, and tools.require_approval.
Application boot order:
logging → workspace → memory → ai → permissions → tools → agents → plugins
Configuration
tools:
shell: false
git: true
python: true
require_approval: true
Custom Approval Callback
For CI or agent contexts, supply a custom approval_callback to ToolRegistry:
registry = ToolRegistry(
require_approval=True,
approval_callback=lambda name, kwargs: True,
)
Policy-as-Code API
The PermissionsService exposes a PolicyManager through the REST API:
GET /api/policies, Lists all configured policy rules.POST /api/policies, Creates a new policy rule.POST /api/policies/evaluate, Evaluates all policies against a context.GET /api/policies/violations, Lists recorded policy violations.
Related Documentation
- Tools
- Configuration
- Security Policies