Zero-to-value walkthrough: add
open_sentienceto your project, install an agent, configure permissions, and run it under governance.
Elixir 1.16+ and OTP 26+
An existing Mix project with a supervision tree
# mix.exs
defp deps do
[
{:open_sentience, "~> 0.1.0"}
]
end
mix deps.get
# lib/my_app/application.ex
def start(_type, _args) do
children = [
# Your existing children...
{OpenSentience.Supervisor, []}
]
opts = [strategy: :one_for_one, name: MyApp.Supervisor]
Supervisor.start_link(children, opts)
end
This starts the PermissionEngine, AutonomyController, AuditWriter, AgentSupervisor, and MCP Server.
Use the agent_install MCP tool (or call the Elixir API directly):
OpenSentience.install_agent(%{
agent_id: "my-worker",
name: "My Worker Agent",
child_spec: {MyApp.Worker, []},
permissions: %{
granted: [
%{type: :filesystem, access: :read, resource: "/data/**"},
%{type: :network, access: :outbound, resource: "api.example.com"}
],
denied: [
%{type: :filesystem, access: :write, resource: "/etc/**"}
]
}
})
The agent is now in the installed state. It is registered but not running.
Verify what the agent can and cannot do:
OpenSentience.permission_check("my-worker", :filesystem, :read, "/data/input.csv")
# => {:allow, "explicit grant: /data/**"}
OpenSentience.permission_check("my-worker", :filesystem, :write, "/etc/passwd")
# => {:deny, "explicit denial: /etc/**"}
OpenSentience.permission_check("my-worker", :network, :inbound, "0.0.0.0:8080")
# => {:deny, "default deny: no matching grant"}
# Transition from installed to enabled
OpenSentience.enable_agent("my-worker")
# The agent starts under the AgentSupervisor.
# Default autonomy level is :observe — the agent can see but not act.
Progress the agent through graduated autonomy:
# Check current level
OpenSentience.autonomy_level("my-worker")
# => :observe
# Promote to advise (agent queues actions for approval)
OpenSentience.set_autonomy_level("my-worker", :advise)
# After building trust, promote to act (autonomous within permissions)
OpenSentience.set_autonomy_level("my-worker", :act)
Each change is recorded in the audit trail.
OpenSentience.audit("my-worker", type: :lifecycle_transition, limit: 10)
# => [
# %{id: "...", timestamp: ~U[...], event_type: :lifecycle_transition,
# operation: "installed -> enabled", result: :ok, actor: "system", ...},
# %{id: "...", timestamp: ~U[...], event_type: :autonomy_change,
# operation: "observe -> advise", result: :ok, actor: "operator", ...},
# ...
# ]
The audit trail is append-only. Entries cannot be modified or deleted.
Move agents through the full lifecycle as needed:
# Graceful stop (running -> enabled -> disabled)
OpenSentience.disable_agent("my-worker")
# Re-enable later
OpenSentience.enable_agent("my-worker")
# Permanent removal (must be disabled first)
OpenSentience.remove_agent("my-worker")
Read architecture.md to understand the OTP internals
Read skills/03_PERMISSIONS.md for the full permission model
Read skills/04_AUTONOMY_LEVELS.md for autonomy details
Read skills/06_INTEGRATION.md to connect with Graphonomous,
Delegatic, and the rest of the [&] ecosystem
Every operation above is also available as an MCP tool for LLM agents:
| Elixir API | MCP Tool | Purpose |
|---|---|---|
install_agent/1 | agent_install | Register agent with permissions |
enable_agent/1 | agent_enable | Start the governed process |
disable_agent/1 | agent_disable | Graceful stop |
agent_status/1 | agent_status | Current state and metadata |
audit/2 | agent_audit | Query audit trail |
permission_check/4 | permission_check | Evaluate a permission |
set_autonomy_level/2 | autonomy_level | Get or set autonomy |