spectre — zsh — en

whoami

Spectre. Your agents do the work. Your business sets the rules.

cat manifesto.md

The only right way to build enterprise AI agents.

Put AI to work where decisions have consequences. Spectre combines OTP supervision with GAM to govern consequential actions, enforce the permissions you grant, and request human approval where you require it. Your rules. Your state. Your audit trail.

01 / authority

Authority stays with you

Models propose work. Your application grants authority. GAM checks every governed operation before execution.

02 / operate

Build agents you can operate

Explicit state, supervised processes and recoverable sessions give your team control over the agent lifecycle.

03 / audit

Keep the record. Own the outcome.

Track decisions, attempts and observed results. Require human approval for the operations your business protects.

ls -1 posts/ | wc -l 18 github.com/elchemista/ex_blog

$

cat GOVERNED_ACT_MODEL.md

Governed Act Model

The constitution of Spectre
governance/constitution.md

The constitution of Spectre

Intelligence proposes. It does not grant itself power.

The Governed Act Model contains the logic and philosophy every agentic system should follow: separate knowledge, capability, and authority; record every governed consequence; and never erase what remains unresolved.

01 / bounds

Mandate

02 / informs

Evidence

03 / records

Act

04 / preserves

Duty

execution boundary

  1. 01 proposal
  2. 02 Mandate + Evidence
  3. 03 Act
  4. 04 world
  5. 05 Duty if unresolved

One model, four forms, no side doors.

open --governed-act-model

Read the full manifesto

man spectre

The Spectre philosophy

spectre/README.md

Build agents around supervised OTP processes, explicit state and application callbacks. Stack installs capabilities, Agent recognizes intent, and Server owns the conversation. GAM (Governed Act Model) checks authority before governed operations execute and records their observed outcomes.

The model proposes

A model prepares a candidate; configured authority and required human consent determine whether GAM admits it.

Routing combines evidence

Combine regex, reviewed examples, vector similarity and classifier models; Server callbacks own what happens next.

Skills keep independent state

Mounted Skills have separate Server processes and checkpoints while sharing their root agent’s GAM Domain and mount restrictions.

cat GAM.md

From a proposed consequence to a recorded outcome:

  • declare and register the concrete operation
  • check the caller’s configured authority
  • show the exact consequence and collect required human consent
  • execute only after GAM admission
  • record the observed result, including uncertainty

A Spectre agent should read like a map, not a magic trick.

stack_agent_server.ex elixir

Stack → Agent → Server: install capabilities, combine regex, embeddings and model classification, then handle the selected intent in ordinary callbacks. MyApp.Embeddings and MyApp.IntentModel are application-supplied providers; the mail example requires optional spectre_kinetic.

# 1. Stack: optional Kinetic registers the typed mail tool and effect.
defmodule MyApp.AI do
  use Spectre.Stack
  install Spectre.Kinetic, mode: :closed_moves,
    actions: MyApp.MailActions, modes: [send_email: :write]
end

# 2. Agent: recognize intent with patterns, similarity or a model.
defmodule MyApp.SupportAgent do
  use Spectre.Agent, stack: MyApp.AI, server: MyApp.SupportServer
  embedding MyApp.Embeddings
  classifier :llm, MyApp.IntentModel
  router strategies: [:regex, :embedding, :llm_classifier]

  flow :support do
    on :pricing, regex: ~r/\b(price|pricing)\b/i,
      semantic_examples: ["How much does a subscription cost?"]
    on :send_email, regex: ~r/^send email$/i,
      semantic_examples: ["Send the prepared message"]
  end
end

# 3. Server: return responses or concrete governed proposals.
defmodule MyApp.SupportServer do
  use Spectre.Server, tools: MyApp.AI

  @impl true
  def handle_flow({:support, :pricing}, _input, ctx),
    do: respond(ctx, "Plans start at EUR 20 per month.")

  def handle_flow({:support, :send_email}, _input, ctx),
    do: propose(ctx, {:kinetic, :send_email},
      %{"to" => "team@example.com", "body" => "The report is ready."},
      on_result: :sent)

  def handle_flow(:unmatched, _input, ctx),
    do: respond(ctx, "Ask about pricing or send the prepared email.")

  @impl true
  def handle_result(:sent, {:governed, %{outcome: %{status: :succeeded}}}, ctx),
    do: respond(ctx, "The registered mail operation completed.")

  def handle_result(tag, result, ctx), do: super(tag, result, ctx)
end

{:ok, server} = Spectre.Server.start_link(
  agent: MyApp.SupportAgent, consumer: self(),
  identity: %{subject: "customer-42"},
  gam: [operations: %{{:kinetic, :send_email} => [confirm: true]}])

{:ok, interaction} = Spectre.Server.input(server, "What is the price?")
receive do
  {Spectre.Server, ^server, {:response, ^interaction, text, _meta}} ->
    IO.puts(text)
after
  5_000 -> raise "No response"
end

Define the typed action catalog before compiling the Stack. This fixture simulates delivery; replace its implementation with your mail transport. The configured consumer renders the exact request and submits the human’s separate choice.

# Host-owned catalog; define before compiling MyApp.AI.
# This function simulates delivery and sends no real email.
defmodule MyApp.MailActions do
  use SpectreKinetic
  @al ~s(SEND EMAIL TO="team@example.com" BODY="The report is ready.")
  @doc "Simulate delivery; replace with the application's mail transport."
  @spec send_email(String.t(), String.t()) :: {:ok, map()}
  def send_email(to, body), do: {:ok, %{to: to, body: body, simulated: true}}
end

# Continue in the configured consumer, using server from the first example.
{:ok, email_interaction} = Spectre.Server.input(server, "send email")
receive do
  {Spectre.Server.GAM.Managed, _owner, {:presentation, material}} ->
    IO.puts(material["rendered_payload"])
    ref = material["presentation_ref"]
    :ok = Spectre.Server.presented(server, ref)
    receive do
      {Spectre.Server, ^server, {:pending, ^email_interaction, _id}} -> :ok
    after
      5_000 -> raise "Consent wait unavailable"
    end
    choice = if IO.gets("Confirm? Type yes: ") == "yes\n", do: :confirm, else: :reject
    Spectre.Server.decide(server, nil, ref, choice)
after
  5_000 -> raise "No presentation"
end
request_lifecycle.txt

How a governed request moves from recognition to an observed result.

Stack — installed tools and supervised resources
└── Agent router — patterns · vectors · classifier models
└── Server callbacks — conversation state and continuations
├── workers — models and cognitive tools
└── Managed GAM — configured authority and required consent
├── Presentation — exact consequence shown to the human
└── Act → executor → Outcome — admission and observed execution remain distinct
$ why --like-this

Use models where they help: semantic recognition, classification and generation. Keep application state, tool execution and authority explicit.

Ordinary Elixir callbacks, supervised workers and named continuations keep business behavior readable and testable.

ExBlog keeps its editorial integration on Spectre 0.4's retained compatibility APIs. The example above shows AgentServer for new applications.

github.com/elchemista/ex_blog — this site, open source

governed_execution.txt

cat GAM.md

From intent to authorized execution

Spectre 0.4.0 routes requests to Server callbacks, runs models and tools in workers, and admits configured operations through GAM. Required human consent binds the exact presentation; the execution outcome remains a separate recorded fact.

  1. 01 / recognize

    Recognize intent

    Combine route evidence and select a declared Server handler.

  2. 02 / propose

    Prepare the operation

    Freeze the concrete arguments and registered execution contract.

  3. 03 / admit

    Verify authority and consent

    GAM checks the mandate and any required human approval before execution.

  4. 04 / observe

    Record the outcome

    Keep success, refusal and uncertain external results separate; reconcile before retrying.

An approval authorizes the presented operation; only an observed successful Outcome establishes that it completed.

ls -1 spectre*

One core, optional powers

10 libraries

cat STACK.md

Start with the core and install only the capabilities your application needs: memory, planning, browser access, model selection, channels, storage or agent messaging. Mounted Skills can run independently while sharing the root agent’s GAM Domain.

Installing a package exposes tools and resources. The Server queues work; registered effect adapters and configured GAM operations define the governed execution path.

spectre foundation · runtime

The OTP core for AgentServer conversations, workers, routing and GAM authority. Runs in RAM without any satellite package.

github.com/elchemista/spectre

spectre_mnemonic capability · memory

Explicit memory search, recall and writes in authenticated application partitions.

github.com/elchemista/spectre_mnemonic

spectre_ledger capability · storage

Persist Server checkpoints, coordination and canonical GAM history, with file and PostgreSQL backends.

github.com/elchemista/spectre_ledger

spectre_kinetic capability · actions

Interpret consolidated model output into validated action proposals; admitted operations reach the registered executor.

github.com/elchemista/spectre_kinetic

spectre_pulse capability · protocol

Authenticated agent messaging across transports; delivery receipts never stand in for human consent.

github.com/elchemista/spectre_pulse

spectre_directive capability · missions

Pure resumable mission reducers that return requests for the Server to handle.

github.com/elchemista/spectre_directive

spectre_lens capability · browser

Navigate, inspect and act through supervised browser resources with explicit governed bindings.

github.com/elchemista/spectre_lens

spectre_prism capability · models

Select model profiles for generation, classification and embeddings using host-defined providers and constraints.

github.com/elchemista/spectre_prism

spectre_beam capability · channels

Normalize channel input and deliver through configured adapters; bind consequential sends to GAM.

github.com/elchemista/spectre_beam

spectre_lab capability · debugging

Inspect bounded Server diagnostics and checkpoint metadata, with separate offline archive tools.

github.com/elchemista/spectre_lab

$ spectre status --ecosystem

curl -s spectre_ecosystem/status.json

Compatibility with the tested core

Each report records the core and satellite revisions it tested. This page displays the published results and their timestamp; a passing row describes that tested combination.

10 libraries checked 10 passing

elchemista.github.io/spectre_ecosystem — the full report, refreshed by its own scheduled run

Related tools: vettore, ex_fastembed, ex_gram.

ls -lat posts/

Latest posts

Notes written while building all of the above.

18 files
posts/en/why-i-created-gam-governed-act-model.md

cat posts/en/why-i-created-gam-governed-act-model.md

Why I Created GAM: An AI Agent Needs Authority, Not Just Tools

There is a pattern I keep seeing. Build an AI agent. Give it tools. It works beautifully in a demo. Then somebody asks: “Can the agent really do that?” We add a permission check. Then: “But who approved the permission?”

#Software Development 9 min en open
posts/en/spectre-0-4-agents-authority-and-human-control.md

cat posts/en/spectre-0-4-agents-authority-and-human-control.md

Spectre 0.4: Agents That Work Within Explicit Authority

An agent drafts a customer email. The text is good. The recipient is correct. The model is confident. Can it send? That question is not another text generation problem. It concerns the application's authority, the person

#Software Development 8 min en open
posts/en/spectre-external-gam-invoice-approval-between-agents.md

cat posts/en/spectre-external-gam-invoice-approval-between-agents.md

One Agent Wants to Send an Invoice. Another Asks the Boss.

Imagine a company where an AI assistant does the everyday work. A customer asks for an invoice. The assistant finds the record, prepares the message and knows which tool can send it. It is ready. Except it is not allowed

#Software Development 9 min en open
posts/en/spectre-0-4-stack-agent-routes-server-architecture.md

cat posts/en/spectre-0-4-stack-agent-routes-server-architecture.md

Spectre 0.4: Your Agent Is More Than a Tool Loop

A chatbot answers a question. An agent can act. Now imagine it has a hundred customers, three different tools, a database outage, a message arriving while it is still thinking, and a manager who wants to know why it sent

#Software Development 8 min en open
posts/en/the-prompt-injection-that-comes-back-a-month-later.md

cat posts/en/the-prompt-injection-that-comes-back-a-month-later.md

The Prompt Injection That Comes Back a Month Later

Version note — 17 November 2026. This article predates Spectre 0.4. Its examples and architecture describe the version available at its original publication date. For current AgentServer applications use the 0.4 document

#AI Security 10 min en open
posts/en/is-your-ai-agent-ready-for-gdpr.md

cat posts/en/is-your-ai-agent-ready-for-gdpr.md

Is Your AI Agent Really Ready for GDPR?

Version note — 17 November 2026. This article predates Spectre 0.4. Its examples and architecture describe the version available at its original publication date. For current AgentServer applications use the 0.4 document

#AI Governance 10 min en open
posts/en/beam-vm-elixir-serious-ai-agents.md

cat posts/en/beam-vm-elixir-serious-ai-agents.md

BEAM Wasn't Built for AI, but It Feels Made for Serious Agents

Version note — 17 November 2026. This article predates Spectre 0.4. Its examples and architecture describe the version available at its original publication date. For current AgentServer applications use the 0.4 document

#Software Development 11 min en open
posts/en/skill-is-not-markdown-file-how-spectre-was-born.md

cat posts/en/skill-is-not-markdown-file-how-spectre-was-born.md

A Skill Is Not a Markdown File: The Reasoning That Led Me to Spectre

Version note — 17 November 2026. This article predates Spectre 0.4. Its examples and architecture describe the version available at its original publication date. For current AgentServer applications use the 0.4 document

#Software Development 13 min en open
posts/en/enterprise-agents-spectre-control-security.md

cat posts/en/enterprise-agents-spectre-control-security.md

An Enterprise Agent Is Not a Chatbot with Production Credentials

Version note — 17 November 2026. This article predates Spectre 0.4. Its examples and architecture describe the version available at its original publication date. For current AgentServer applications use the 0.4 document

#Software Development 14 min en open
posts/en/deepseek-harness-vs-spectre-plugins-or-kernel.md

cat posts/en/deepseek-harness-vs-spectre-plugins-or-kernel.md

When Even the Laws of Physics Are Plugins: DeepSeek Harness vs Spectre

Version note — 17 November 2026. This article predates Spectre 0.4. Its examples and architecture describe the version available at its original publication date. For current AgentServer applications use the 0.4 document

#Software Development 14 min en open
posts/en/humans-govern-loop-spectre-streaming-0-3-2.md

cat posts/en/humans-govern-loop-spectre-streaming-0-3-2.md

Humans Should Govern the Loop, Not Run It

Version note — 17 November 2026. This article predates Spectre 0.4. Its examples and architecture describe the version available at its original publication date. For current AgentServer applications use the 0.4 document

#Software Development 12 min en open
posts/en/do-not-trust-the-model-test-spectre-agents-like-software.md

cat posts/en/do-not-trust-the-model-test-spectre-agents-like-software.md

Do Not Trust the Model: Test a Spectre Agent Like Software

Version note — 17 November 2026. This article predates Spectre 0.4. Its examples and architecture describe the version available at its original publication date. For current AgentServer applications use the 0.4 document

#Software Development 15 min en open
posts/en/spectre-morph-build-an-agent-that-can-evolve.md

cat posts/en/spectre-morph-build-an-agent-that-can-evolve.md

Spectre Morph: Build an Agent That Can Evolve Without Rewriting Itself

Version note — 17 November 2026. This article predates Spectre 0.4. Its examples and architecture describe the version available at its original publication date. For current AgentServer applications use the 0.4 document

#Software Development 18 min en open
posts/en/spectre-news-agent-lens-kinetic-action-language.md

cat posts/en/spectre-news-agent-lens-kinetic-action-language.md

Build a Useful Spectre News Agent with Lens, Kinetic, and Action Language

Version note — 17 November 2026. This article predates Spectre 0.4. Its examples and architecture describe the version available at its original publication date. For current AgentServer applications use the 0.4 document

#Software Development 15 min en open
posts/en/a-turn-is-not-a-model-call-spectre-otp-policies.md

cat posts/en/a-turn-is-not-a-model-call-spectre-otp-policies.md

A Turn Is Not a Model Call: How Spectre Governs Agents with OTP

Version note — 17 November 2026. This article predates Spectre 0.4. Its examples and architecture describe the version available at its original publication date. For current AgentServer applications use the 0.4 document

#Software Development 13 min en open
posts/en/the-agent-should-exist-in-code-not-in-the-prompt.md

cat posts/en/the-agent-should-exist-in-code-not-in-the-prompt.md

The Agent Should Exist in Code, Not in the Prompt

Version note — 17 November 2026. This article predates Spectre 0.4. Its examples and architecture describe the version available at its original publication date. For current AgentServer applications use the 0.4 document

#Software Development 11 min en open
posts/en/getting-started-with-spectre.md

cat posts/en/getting-started-with-spectre.md

Getting Started with Spectre: Your First Agent Is Not a Loop

Updated guidance — 17 November 2026. This article documents the earlier 0.3 Instance/Run API and remains available as historical context. For new applications use the Spectre 0.4 AgentServer quickstart /en/docs/getting s

#Software Development 14 min en open
posts/en/building-a-blog-agent-with-spectre.md

cat posts/en/building-a-blog-agent-with-spectre.md

Building a Blog Agent with Spectre, Not Around a Magic Loop

Version note — 17 November 2026. This article predates Spectre 0.4. Its examples and architecture describe the version available at its original publication date. For current AgentServer applications use the 0.4 document

#Software Development 12 min en open