# agent-core (https://docs.neuralisapp.com/agent-core)

<Callout title="Maturity: beta (80 %)">
**Agent core.** One durable agent stream across many model providers, with a sandboxed execute shell, Agent Skills, delegation, approvals, MCP in both directions, workflows, channels, a terminal and limits on every run.

- Confined shells need a Linux host kernel with Landlock support; without it, lower-trust shells are refused rather than run unconfined.
- Workflows and channels run in a single process; a second replica would run every schedule twice.
- Subscription model usage is not metered in money, so money spend caps do not bind it.
- Container terminal sessions end when the app restarts.

[How maturity is measured](https://docs.neuralisapp.com/getting-started/maturity.md)
</Callout>

`@neuralis/agent-core` is the runtime kernel of Neuralis. It owns the agentic
loop end to end — model providers, conversation assembly and persistence, tool
execution, policy and hook evaluation, and live delivery to the chat — and it
is the package that loads every *other* package. The package loader, the
contribution host and the generic MCP server all live here, so every capability
any package declares reaches the model through agent-core, whichever path the
package arrived by. That makes it the package protocol's first provider and its
universal consumer at once.

One stream serves three consumers: interactive chat, [subagents](https://docs.neuralisapp.com/agent-core/agents.md)
and scheduled [workflows](https://docs.neuralisapp.com/agent-core/workflows.md) run the same loop, with the
same billing, gating, quotas and persistence. agent-core does **not** own
filesystem indexing ([brain-core](https://docs.neuralisapp.com/brain-core.md)), admin surfaces
([admin](https://docs.neuralisapp.com/admin.md)) or virtual desktops ([machine-core](https://docs.neuralisapp.com/machine-core.md)).

## What agent-core ships [#what-agent-core-ships]

| Element | What it ships | Page |
| --- | --- | --- |
| `tools` | 9 tools: `execute`, `delegate`, `workflow`, `web_search`, `web_fetch`, `ask_question`, `connect`, `todos`, `compact_history` | [Tools](https://docs.neuralisapp.com/agent-core/tools.md) |
| `skills` | 17 skill bundles — management, execution patterns, research, inspection, learning | [Skills](https://docs.neuralisapp.com/agent-core/skills.md) |
| `agents` | 7 base subagents: `explore`, `research`, `planner`, `execute`, `validate`, `operate`, `general` | [Agents](https://docs.neuralisapp.com/agent-core/agents.md) |
| `instructions` | `neuralis-kernel` — always injected (below) | this page |
| `rules` | `tool-use` — always injected (below) | this page |
| `workflows` | 3 templates: Daily digest, Channel assistant, Learning | [Workflows](https://docs.neuralisapp.com/agent-core/workflows.md) |
| `team` | 1 member: `admin` | [Team](https://docs.neuralisapp.com/agent-core/team.md) |
| `routes` | the conversation, agent, stream, MCP, workflow, channel, credential, device and terminal routes | [Routes](https://docs.neuralisapp.com/agent-core/routes.md) |
| `app.surfaces` | Chat, Calendar and Terminal widgets; Calendar and Terminal docks | [App surfaces](https://docs.neuralisapp.com/agent-core/app-surfaces.md) |
| `events` | 8 workflow and device events | [Events](https://docs.neuralisapp.com/agent-core/events.md) |
| `credentials` | 21 declared ids — model providers, web search, git and WhatsApp OAuth apps | [Credentials](https://docs.neuralisapp.com/agent-core/credentials.md) |
| `configSettings` | 195 platform settings | [Config settings](https://docs.neuralisapp.com/agent-core/config-settings.md) |
| channels | messaging channels (Telegram, WhatsApp) that fire workflows; realtime channels `conversation`, `devices`, `presence`, `workflow` | [Channels](https://docs.neuralisapp.com/agent-core/channels.md) (guide), [Events](https://docs.neuralisapp.com/agent-core/events.md) |
| providers | the model catalog and provider adapters | [Providers and models](https://docs.neuralisapp.com/agent-core/providers-and-models.md) (guide) |

## Instructions and rules [#instructions-and-rules]

Two always-on markdown files are injected into every turn's system prompt, at
the one injection boundary where they inherit the package's enable state and
the caller's feature scope — a disabled package's files are never injected. An
injected file arrives without its frontmatter. They are the always-on baseline;
procedures live in [skills](https://docs.neuralisapp.com/agent-core/skills.md), which load on demand, and every
visible tool's description and schema is sent on every step.

| File | What it carries |
| --- | --- |
| `instructions/neuralis-kernel.md` | The platform model — every capability is a package; how to read the system prompt in order; that tools come from packages and the filesystem is the universal substrate; how to find and chain skills; how to keep working state (the durable goal, loop and todos in the `<session>` block, which survive compaction and restart) and where durable memory lives; and the operating directives: act before asking, read before editing, edit the real file, keep one plan and finish it, verify before claiming done, never revert changes you did not make, lead with the result. |
| `rules/tool-use.md` | The baseline for calling tools: schema-valid input and no printed tool markup; errors and approval pauses handled correctly; the discipline for the `execute` shell when it is granted; and caution before irreversible or outward-facing actions — never a destructive shortcut to skip a check. |

Each agent holds every package in one of three states: **on**, **off** or
**excluded**. An off package stays listed in the agent's package overview as
off, so the agent knows it exists, while its tools, injected files, skills,
prompt hooks, commands and resources are withheld from the agent. An excluded package is
withheld the same way and is also left out of that overview. Guard and audit
hooks keep running in both states. The package listing routes mark an excluded
package with `excluded: true`.

**Durable memory** comes at two scopes, both written through the filesystem
tools so the content is indexed for recall: **project-central memory**, which
every member's agents can read and only owners and admins write, and
**per-agent memory**, private to that agent (owners and admins can read it for
oversight). Business data such as analytics or CRM is connected as a brain
source, not pasted into memory.

Every agent is private to its creator until a user is attached to it in
Admin → Agents; an attached user shares the agent's memory, identity,
workflows, plans and logs, and every run carries the rights of the user who
started it ([Agent data and conversations](https://docs.neuralisapp.com/enterprise/security.md#agent-data-and-conversations)).

## Provided features [#provided-features]

The manifest declares the feature vocabulary other layers gate on (see
[features](https://docs.neuralisapp.com/package-system/features.md)). "Admin tier" below means: no grant below
`admin` — `admin` holds it through its enumerated default grant, `owner` through
the `'*'` wildcard — and grantable to any custom role.

| Feature | What it grants |
| --- | --- |
| `core.agents` | View and manage agents; list devices. |
| `core.execute` | Start agent streams and use the chat loop, conversations, interactions and the `execute` tool; polish composer drafts with a one-shot rewrite; branch a continuable fork of a conversation you may continue. A packaged skill's shell scripts need `server.shell` beside it. |
| `server.shell` | The agent's shell and the Terminal panel **on the server** — the app container, or the server's own machine without Docker. Granted wherever `core.execute` is. A door, not a bypass: the source's path policy still decides where a command or a tab may start. A terminal tab on a paired computer also needs `device.own` or `device.others`. |
| `server.unconfined` | Run the agent's shell and open the **Container Root** terminal tab on the server without the path policy and OS sandbox (admin tier). It grants nothing on a paired computer or a remote source. |
| `device.others` | Run `execute` and open terminal tabs on a paired computer **you do not own**, only while it runs sandboxed, and see the folder paths of other members' computers (admin tier). Not enough without a paired, online computer. |
| `device.own` | Pair your own computer, attach folders on it, and run commands and terminal tabs there — on your own computer only. Member, manager and admin by default. |
| `core.observe` | Read-only introspection: usage, logs view, tool/file catalogs, package overview, MCP servers, connectors, models. |
| `core.web` | The `web_search` / `web_fetch` tools. Storing a fetched page also needs `files.write`. |
| `project.audit` | Read an agent's `run` log (admin tier). The platform-global logs need `platform.audit`. |
| `core.connectors` | Create, configure, connect and delete a project's connectors (admin tier). |
| `terminal.supervise` | List, attach to, take over and terminate every managed terminal in the project (admin tier); sessions on a paired computer also need `device.others`. |
| `workflow.read` / `.write` / `.dispatch` | View; create, edit, pause and archive; run now and cancel. |
| `channels.connect` / `channels.manage` | Connect your **own** Telegram/WhatsApp accounts; manage project-scope connections and link peers to other users (owner/admin). |
| `mcp.connect` | Connect your **own** external MCP servers and store their tokens in your user scope; with `device.own`, run a stdio server on your own paired device. |
| `mcp.sidecar` | Activate stdio MCP servers in a managed sidecar container (admin tier). |
| `mcp.apps` | Render MCP Apps (`ui://` HTML) as chat cards (admin tier). |
| `git.connect` | Connect your **own** git remotes. |
| `credentials.self` | Set, remove and list your **own** credentials. |

**Default grants.** Managers and members get agents, execute, observe, web,
prompt-polish, `server.shell`, `channels.connect`, `mcp.connect`,
`git.connect`, `credentials.self` and workflow read/write (managers also
`workflow.dispatch`); viewers get agents, observe and `workflow.read`. The
seeded `owner` holds `'*'`. The seeded `admin` holds an enumerated list declared
by this manifest: everything above, including the admin-tier features no weaker
role receives.

Feature ids name the plane a shell opens on — `server.shell`, `device.others`, and
whatever id an exec-capable source declares (the virtual desktop's is
`machine.control`); the terminal ids follow the same words. `*.unconfined` means
"unrestricted on the local plane" and never reaches a device; a device's owner
uses it through `device.own`, and its own confinement is the boundary.

## Cross-package position [#cross-package-position]

- The **package loader** discovers each package's
  [directory contract](https://docs.neuralisapp.com/package-system/directory-contract.md) at bootstrap.
- The **contribution host** aggregates hosted tools, prompts and resources and
  routes calls back to the owning package.
- The **stream** is the single injection boundary: contributions are filtered
  by package enable state and the caller's features before anything reaches the
  prompt, and again at the external MCP boundary.
- Other packages call agent-core in-process through typed APIs
  ([lifecycle](https://docs.neuralisapp.com/package-system/lifecycle.md)), never over internal MCP; agent-core
  reaches brain-core's filesystem the same way. Its per-agent `usage/**` folder
  is declared as machine-written metrics, so new data sources exclude it by
  default.

## Consuming external MCP servers [#consuming-external-mcp-servers]

Neuralis is also a spec-compliant MCP **client**: agents connect out to
external servers, with OAuth in your own scope, secret header slots, and stdio
servers in a managed sidecar or on your own paired device — see [MCP servers](https://docs.neuralisapp.com/agent-core/routes.md#mcp-servers).
A server tool that declares a `ui://` template renders as an interactive
[MCP App](https://docs.neuralisapp.com/agent-core/app-surfaces.md#mcp-apps) card. Over its own generic MCP
server, agent-core exposes a selected tool set to external clients — see
[MCP access](https://docs.neuralisapp.com/enterprise/mcp-access.md).

## Folder map [#folder-map]

The pages in this section mirror agent-core's package folders:

| Package folder | Doc page | Cross-reference |
| --- | --- | --- |
| `tools/` (9 JSON schemas) | [Tools](https://docs.neuralisapp.com/agent-core/tools.md) | [package-system tools](https://docs.neuralisapp.com/package-system/tools.md) |
| `skills/` (17 bundles) | [Skills](https://docs.neuralisapp.com/agent-core/skills.md) | [package-system skills](https://docs.neuralisapp.com/package-system/skills.md) |
| `agents/` (7 base subagents) | [Agents](https://docs.neuralisapp.com/agent-core/agents.md) | [package-system agents](https://docs.neuralisapp.com/package-system/agents.md) |
| `instructions/`, `rules/` | [this page](#instructions-and-rules) | [instructions](https://docs.neuralisapp.com/package-system/instructions.md), [rules](https://docs.neuralisapp.com/package-system/rules.md) |
| `workflows/` (3 templates) | [Workflows](https://docs.neuralisapp.com/agent-core/workflows.md) | [package-system workflows](https://docs.neuralisapp.com/package-system/workflows.md) |
| `team/` (1 member) | [Team](https://docs.neuralisapp.com/agent-core/team.md) | [package-system team](https://docs.neuralisapp.com/package-system/team.md) |
| `src/routes/`, `connectors/`, `src/git/` | [Routes](https://docs.neuralisapp.com/agent-core/routes.md), [Credentials](https://docs.neuralisapp.com/agent-core/credentials.md) | [package-system routes](https://docs.neuralisapp.com/package-system/routes.md) |
| `app/` (chat, calendar, terminal) | [App surfaces](https://docs.neuralisapp.com/agent-core/app-surfaces.md) | [package-system App surfaces](https://docs.neuralisapp.com/package-system/app-surfaces.md) |
| `src/channels/` | [Channels](https://docs.neuralisapp.com/agent-core/channels.md), [Events](https://docs.neuralisapp.com/agent-core/events.md) | [package-system events](https://docs.neuralisapp.com/package-system/events.md) |
| `providers/` | [Providers and models](https://docs.neuralisapp.com/agent-core/providers-and-models.md) | — |

## In this section [#in-this-section]

<Cards>
<Card title="Tools" href="https://docs.neuralisapp.com/agent-core/tools.md" description="tools[] — the native tools: execute, delegate, workflow, the web tools, connect, mcp and the context tools." />

<Card title="Skills" href="https://docs.neuralisapp.com/agent-core/skills.md" description="skills[] — the seventeen bundles and the session ticket they call routes with." />

<Card title="Agents" href="https://docs.neuralisapp.com/agent-core/agents.md" description="agents[] — the seven base subagents and how delegate narrows them." />

<Card title="Workflows" href="https://docs.neuralisapp.com/agent-core/workflows.md" description="workflows[] — scheduled and webhook-fired agent work, the run queue, creator identity, templates." />

<Card title="Team" href="https://docs.neuralisapp.com/agent-core/team.md" description="team[] — the Admin member and living identity files." />

<Card title="Routes" href="https://docs.neuralisapp.com/agent-core/routes.md" description="routes — the feature-gated HTTP surface and external MCP servers." />

<Card title="App surfaces" href="https://docs.neuralisapp.com/agent-core/app-surfaces.md" description="app.surfaces[] — the Chat, Calendar and Terminal widgets." />

<Card title="Events" href="https://docs.neuralisapp.com/agent-core/events.md" description="events[] — the workflow and device notifications." />

<Card title="Credentials" href="https://docs.neuralisapp.com/agent-core/credentials.md" description="credentials[] — declared ids, your own keys, git remotes." />

<Card title="Config settings" href="https://docs.neuralisapp.com/agent-core/config-settings.md" description="configSettings[] — the 195 platform settings, by group." />

<Card title="Channels" href="https://docs.neuralisapp.com/agent-core/channels.md" description="Guide: Telegram and WhatsApp into your workflows." />

<Card title="Providers and models" href="https://docs.neuralisapp.com/agent-core/providers-and-models.md" description="Guide: the model catalog, custom endpoints and usage." />
</Cards>