> For the complete documentation index, see [llms.txt](https://docs.talus.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talus.network/reference/move/nexus_registry/agent_registry.md).

# agent\_registry

* [Struct `AgentRegistry`](#struct-agentregistry)
* [Struct `AgentRegistryInnerV1`](#struct-agentregistryinnerv1)
* [Struct `DefaultDagExecutorFieldKey`](#struct-defaultdagexecutorfieldkey)
* [Struct `DefaultDagExecutor`](#struct-defaultdagexecutor)
* [Struct `AgentRecord`](#struct-agentrecord)
* [Struct `SkillRecord`](#struct-skillrecord)
* [Struct `SkillContractRevisionedEvent`](#struct-skillcontractrevisionedevent)
* [Struct `SkillRegisteredEvent`](#struct-skillregisteredevent)
* [Struct `DefaultDagExecutorUpdatedEvent`](#struct-defaultdagexecutorupdatedevent)
* [Enum `SkillContractState`](#enum-skillcontractstate)
* [Constants](#constants)
* [Function `share_registry`](#function-share_registry)
* [Function `create_agent`](#function-create_agent)
* [Function `attach_embedded_agent`](#function-attach_embedded_agent)
* [Function `register_skill`](#function-register_skill)
* [Function `bootstrap_default_runtime_dag_skill_for_deployment`](#function-bootstrap_default_runtime_dag_skill_for_deployment)
* [Function `get_skill_requirements`](#function-get_skill_requirements)
* [Function `new_default_task_components`](#function-new_default_task_components)
* [Function `withdraw_agent_payment_vault`](#function-withdraw_agent_payment_vault)
* [Function `default_dag_executor_agent_id_from_registry`](#function-default_dag_executor_agent_id_from_registry)
* [Function `default_dag_executor_skill_id_from_registry`](#function-default_dag_executor_skill_id_from_registry)
* [Function `is_default_dag_executor_skill`](#function-is_default_dag_executor_skill)
* [Function `skill_pinned_dag_id_for_skill`](#function-skill_pinned_dag_id_for_skill)
* [Function `skill_requirements_for_skill`](#function-skill_requirements_for_skill)
* [Function `get_agent_skill_record`](#function-get_agent_skill_record)
* [Function `classify_skill_contract`](#function-classify_skill_contract)
* [Function `skill_contract_is_current`](#function-skill_contract_is_current)
* [Function `skill_contract_is_inactive`](#function-skill_contract_is_inactive)
* [Function `resolve_agent_execution_config_dag`](#function-resolve_agent_execution_config_dag)
* [Function `resolve_execution_spec`](#function-resolve_execution_spec)
* [Function `skill_dag_binding`](#function-skill_dag_binding)
* [Function `set_skill_active`](#function-set_skill_active)
* [Function `set_agent_active`](#function-set_agent_active)
* [Function `update_skill_description`](#function-update_skill_description)
* [Function `update_dag`](#function-update_dag)
* [Function `update_skill_policies`](#function-update_skill_policies)

### Struct `AgentRegistry`

Shared registry of Talus agents and their skills, keyed by agent object ID.

```move
public struct AgentRegistry has key
```

<details>

<summary>Fields</summary>

`id: sui::object::UID`

</details>

#### Struct `AgentRegistryInnerV1`

Version one stored layout for \[[`AgentRegistry`](#nexus_registry_agent_registry_AgentRegistry)].

```move
public struct AgentRegistryInnerV1 has store
```

<details>

<summary>Fields</summary>

[`agents`](#nexus_registry_agent_registry_agents)`: sui::table::Table<sui::object::ID,` [`nexus_registry::agent_registry::AgentRecord`](#nexus_registry_agent_registry_AgentRecord)`>`

</details>

#### Struct `DefaultDagExecutorFieldKey`

Dynamic-field key under which the registry stores its \[DefaultDagExecutor].

```move
public struct DefaultDagExecutorFieldKey has copy, drop, store
```

<details>

<summary>Fields</summary>

</details>

#### Struct `DefaultDagExecutor`

Registry-owned default DAG executor for runtime-selected DAG execution.

The value embeds the actual default agent object and is stored as a dynamic field under [`AgentRegistry`](#nexus_registry_agent_registry_AgentRegistry), making the registry the physical owner of the default executor surface.

```move
public struct DefaultDagExecutor has store
```

<details>

<summary>Fields</summary>

`agent:` [`nexus_interface::agent::Agent`](/reference/move/nexus_interface/agent.md#nexus_interface_agent_Agent)`skill_id: u64`

</details>

#### Struct `AgentRecord`

Registry record for one Talus agent.

```move
public struct AgentRecord has store
```

<details>

<summary>Fields</summary>

`active: boolskills: sui::table::Table<u64,` [`nexus_registry::agent_registry::SkillRecord`](#nexus_registry_agent_registry_SkillRecord)`>`

</details>

#### Struct `SkillRecord`

Registry-owned metadata for a skill under an agent.

The skill ID is allocated from the agent-owned `Agent`. The registry keeps a skill table so callers can recover skill requirements without scanning dynamic children under the `Agent`.

```move
public struct SkillRecord has copy, drop, store
```

<details>

<summary>Fields</summary>

`description: vector<u8>active: booldag_binding:` [`nexus_interface::agent::SkillDagBinding`](/reference/move/nexus_interface/agent.md#nexus_interface_agent_SkillDagBinding)`requirements:` [`nexus_interface::agent::SkillRequirement`](/reference/move/nexus_interface/agent.md#nexus_interface_agent_SkillRequirement)`current_interface_revision:` [`nexus_interface::version::InterfaceVersion`](/reference/move/nexus_interface/version.md#nexus_interface_version_InterfaceVersion)

</details>

#### Struct `SkillContractRevisionedEvent`

Emitted when a skill's interface revision advances (binding or policy change).

```move
public struct SkillContractRevisionedEvent has copy, drop
```

<details>

<summary>Fields</summary>

`agent_id: sui::object::IDskill_id: u64current_interface_revision:` [`nexus_interface::version::InterfaceVersion`](/reference/move/nexus_interface/version.md#nexus_interface_version_InterfaceVersion)`dag_binding:` [`nexus_interface::agent::SkillDagBinding`](/reference/move/nexus_interface/agent.md#nexus_interface_agent_SkillDagBinding)`requirements:` [`nexus_interface::agent::SkillRequirement`](/reference/move/nexus_interface/agent.md#nexus_interface_agent_SkillRequirement)

</details>

#### Struct `SkillRegisteredEvent`

Emitted when a new skill is registered under an agent.

```move
public struct SkillRegisteredEvent has copy, drop
```

<details>

<summary>Fields</summary>

`agent_id: sui::object::IDskill_id: u64dag_id: addressdag_binding:` [`nexus_interface::agent::SkillDagBinding`](/reference/move/nexus_interface/agent.md#nexus_interface_agent_SkillDagBinding)

</details>

#### Struct `DefaultDagExecutorUpdatedEvent`

Emitted when the registry-owned default DAG executor target is set or updated.

```move
public struct DefaultDagExecutorUpdatedEvent has copy, drop
```

<details>

<summary>Fields</summary>

`agent_id: sui::object::IDskill_id: u64`

</details>

#### Enum `SkillContractState`

Current relationship between a proposal and one registered skill contract.

\[`Current`] means admission may continue. \[`Inactive`] is temporary and leaves the proposal pending. \[`Stale`] and \[`Missing`] cannot become valid without changing the immutable proposal.

```move
public enum SkillContractState has copy, drop
```

<details>

<summary>Variants</summary>

Variant `Current`Variant `Inactive`Variant `Stale`Variant `Missing`

</details>

#### Constants

```move
#[error]
const EAgentNotFound: vector<u8> = b"Agent not found";
```

```move
#[error]
const ESkillNotFound: vector<u8> = b"Agent skill not found";
```

```move
#[error]
const EActiveEndpointNotFound: vector<u8> = b"No active Agent interface revision";
```

```move
#[error]
const EDefaultDagExecutorMissing: vector<u8> = b"Default DAG executor is missing";
```

```move
#[error]
const EDefaultDagExecutorAlreadyBootstrapped: vector<u8> = b"Default DAG executor is already bootstrapped";
```

```move
#[error]
const EAgentAlreadyExists: vector<u8> = b"Agent already exists";
```

```move
#[error]
const EDagSelectionRequired: vector<u8> = b"Runtime-selected skill requires a DAG selection";
```

```move
#[error]
const EDagSelectionRedundant: vector<u8> = b"Pinned skill rejects caller DAG selection";
```

```move
#[error]
const EFixedToolNotRegistered: vector<u8> = b"Fixed tool is not registered";
```

#### Function `share_registry`

Shares the canonical Agent registry for network use.

Once shared, mutations are guarded by mutable `Agent` custody rather than object ownership of the registry itself.

```move
public fun share_registry(registry: nexus_registry::agent_registry::AgentRegistry)
```

#### Function `create_agent`

Create a Talus agent record and its interface identity object.

The returned mutable `Agent` object becomes the custody handle for later lifecycle and skill-revision updates.

```move
public fun create_agent(registry: &mut nexus_registry::agent_registry::AgentRegistry, ctx: &mut sui::tx_context::TxContext): nexus_interface::agent::Agent
```

#### Function `attach_embedded_agent`

Attach an embedded TAP agent identity to the registry.

This lets examples keep custody of the `Agent` object inside their own state while still using the standard registry for skill discovery and execution resolution.

```move
public fun attach_embedded_agent(registry: &mut nexus_registry::agent_registry::AgentRegistry, agent: &mut nexus_interface::agent::Agent, ctx: &mut sui::tx_context::TxContext)
```

#### Function `register_skill`

Register a pinned-DAG skill.

The caller must have mutable custody of the agent. Revision 1 is stored as the current skill; historical revision lookup belongs to emitted events.

```move
public fun register_skill(registry: &mut nexus_registry::agent_registry::AgentRegistry, agent: &mut nexus_interface::agent::Agent, tool_registry: &nexus_tool::tool_registry::ToolRegistry, dag: &nexus_interface::dag::DAG, description: vector<u8>, input_commitment: vector<u8>, payment_policy: nexus_interface::payment::SkillPaymentPolicy, schedule_policy: nexus_interface::agent::SkillSchedulePolicy, fixed_tools: vector<nexus_interface::agent::FixedTool>, ctx: &mut sui::tx_context::TxContext): u64
```

#### Function `bootstrap_default_runtime_dag_skill_for_deployment`

Bootstrap the standard default runtime-selected DAG skill for deployment.

This is the only public default bootstrap entry. It creates one default agent, allocates one runtime-selected skill, stores revision 1 as the current skill, and records that `(agent, skill)` in the registry default executor. The fixed default floor is intentionally narrow: user-funded zero-cap payments, a once schedule, no fixed tools, and active revision 1.

```move
public fun bootstrap_default_runtime_dag_skill_for_deployment(registry: &mut nexus_registry::agent_registry::AgentRegistry, ctx: &mut sui::tx_context::TxContext): (sui::object::ID, u64)
```

#### Function `get_skill_requirements`

Return requirements for the currently active interface revision.

```move
public fun get_skill_requirements(registry: &nexus_registry::agent_registry::AgentRegistry, agent: &nexus_interface::agent::Agent, skill_id: u64): nexus_interface::agent::SkillRequirement
```

#### Function `new_default_task_components`

Build the scheduled-skill components (authorization and payment reserve) for the registry-owned default DAG executor.

Aborts with \[EAgentNotFound] if the stored default executor agent does not match its recorded ID.

```move
public fun new_default_task_components(registry: &nexus_registry::agent_registry::AgentRegistry, task_id: sui::object::ID, dag_id: sui::object::ID, prepayment: sui::coin::Coin<sui::sui::SUI>, refund_recipient: address, occurrence_budget_mist: u64, ctx: &mut sui::tx_context::TxContext): (nexus_interface::authorization::AgentSkillAuthorization, nexus_interface::payment::TaskPaymentReserve, sui::object::ID, u64)
```

#### Function `withdraw_agent_payment_vault`

Withdraw `amount` from an agent's payment vault to a returned coin.

Aborts with \[EAgentNotFound] if the agent is not registered.

```move
public fun withdraw_agent_payment_vault(registry: &nexus_registry::agent_registry::AgentRegistry, agent: &mut nexus_interface::agent::Agent, amount: u64, ctx: &mut sui::tx_context::TxContext): sui::coin::Coin<sui::sui::SUI>
```

#### Function `default_dag_executor_agent_id_from_registry`

Returns the agent ID of the registry-owned default DAG executor.

Aborts with \[EDefaultDagExecutorMissing] if no default executor has been bootstrapped.

```move
public fun default_dag_executor_agent_id_from_registry(registry: &nexus_registry::agent_registry::AgentRegistry): sui::object::ID
```

#### Function `default_dag_executor_skill_id_from_registry`

Returns the skill ID of the registry-owned default DAG executor.

Aborts with \[EDefaultDagExecutorMissing] if no default executor has been bootstrapped.

```move
public fun default_dag_executor_skill_id_from_registry(registry: &nexus_registry::agent_registry::AgentRegistry): u64
```

#### Function `is_default_dag_executor_skill`

Returns whether the given `(agent_id, skill_id)` is the registry-owned default DAG executor.

Aborts with \[EDefaultDagExecutorMissing] if no default executor has been bootstrapped.

```move
public fun is_default_dag_executor_skill(registry: &nexus_registry::agent_registry::AgentRegistry, agent_id: sui::object::ID, skill_id: u64): bool
```

#### Function `skill_pinned_dag_id_for_skill`

Returns the pinned DAG ID for a skill, or `none` if the skill is runtime-selected.

Aborts with \[ESkillNotFound] if the agent has no such skill.

```move
public fun skill_pinned_dag_id_for_skill(registry: &nexus_registry::agent_registry::AgentRegistry, agent_id: sui::object::ID, skill_id: u64): std::option::Option<address>
```

#### Function `skill_requirements_for_skill`

Returns the requirements for an active skill under an active agent.

Aborts with \[ESkillNotFound] if the skill does not exist, or \[EActiveEndpointNotFound] if the agent or skill is inactive.

```move
public fun skill_requirements_for_skill(registry: &nexus_registry::agent_registry::AgentRegistry, agent_id: sui::object::ID, skill_id: u64): nexus_interface::agent::SkillRequirement
```

#### Function `get_agent_skill_record`

Returns the interface revision, payment policy, and schedule policy for an active skill.

Aborts with \[ESkillNotFound] if the skill does not exist, or \[EActiveEndpointNotFound] if the agent or skill is inactive.

```move
public fun get_agent_skill_record(registry: &nexus_registry::agent_registry::AgentRegistry, agent_id: sui::object::ID, skill_id: u64): (nexus_interface::version::InterfaceVersion, nexus_interface::payment::SkillPaymentPolicy, nexus_interface::agent::SkillSchedulePolicy)
```

#### Function `classify_skill_contract`

Classifies an immutable proposal against current Agent Registry state.

This function never aborts for a missing or inactive Agent or skill. That lets current Scheduler code commit a proven rejection instead of rolling it back through an abort.

```move
public fun classify_skill_contract(registry: &nexus_registry::agent_registry::AgentRegistry, agent_id: sui::object::ID, skill_id: u64, interface_revision: nexus_interface::version::InterfaceVersion, dag_id: sui::object::ID): nexus_registry::agent_registry::SkillContractState
```

#### Function `skill_contract_is_current`

Returns whether a skill contract classification permits admission.

```move
public fun skill_contract_is_current(state: nexus_registry::agent_registry::SkillContractState): bool
```

#### Function `skill_contract_is_inactive`

Returns whether a skill contract may become admissible without changing the proposal.

```move
public fun skill_contract_is_inactive(state: nexus_registry::agent_registry::SkillContractState): bool
```

#### Function `resolve_agent_execution_config_dag`

Resolves the DAG ID an execution config should run, honoring the skill's binding.

For runtime-selected skills, aborts with \[EDagSelectionRequired] if no DAG is selected; for pinned skills, aborts with \[EDagSelectionRedundant] if a DAG is selected. Aborts with \[ESkillNotFound] or \[EActiveEndpointNotFound] if the skill is missing or inactive.

```move
public fun resolve_agent_execution_config_dag(registry: &nexus_registry::agent_registry::AgentRegistry, config: &nexus_interface::agent::AgentExecutionConfig): sui::object::ID
```

#### Function `resolve_execution_spec`

Resolves caller intent into one durable execution target.

```move
public fun resolve_execution_spec(registry: &nexus_registry::agent_registry::AgentRegistry, config: nexus_interface::agent::AgentExecutionConfig): (nexus_interface::agent::ExecutionSpec, sui::vec_map::VecMap<nexus_interface::graph::Vertex, sui::object::ID>, nexus_interface::payment::SkillPaymentPolicy, nexus_interface::agent::SkillSchedulePolicy)
```

#### Function `skill_dag_binding`

Returns the DAG binding for a skill under an agent.

Aborts with \[ESkillNotFound] if the agent has no such skill.

```move
public fun skill_dag_binding(registry: &nexus_registry::agent_registry::AgentRegistry, agent: &nexus_interface::agent::Agent, skill_id: u64): nexus_interface::agent::SkillDagBinding
```

#### Function `set_skill_active`

Activate or deactivate a skill.

Aborts with \[EAgentNotFound] if the agent is not registered.

```move
public fun set_skill_active(registry: &mut nexus_registry::agent_registry::AgentRegistry, agent: &mut nexus_interface::agent::Agent, skill_id: u64, active: bool)
```

#### Function `set_agent_active`

Activate or deactivate an agent.

Aborts with \[EAgentNotFound] if the agent is not registered.

```move
public fun set_agent_active(registry: &mut nexus_registry::agent_registry::AgentRegistry, agent: &mut nexus_interface::agent::Agent, active: bool)
```

#### Function `update_skill_description`

Replace a skill's description.

Aborts with \[EAgentNotFound] if the agent is not registered.

```move
public fun update_skill_description(registry: &mut nexus_registry::agent_registry::AgentRegistry, agent: &mut nexus_interface::agent::Agent, skill_id: u64, description: vector<u8>)
```

#### Function `update_dag`

Repoint a skill to a new pinned DAG, advancing its interface revision.

Aborts with \[EAgentNotFound] if the agent is not registered.

```move
public fun update_dag(registry: &mut nexus_registry::agent_registry::AgentRegistry, agent: &mut nexus_interface::agent::Agent, tool_registry: &nexus_tool::tool_registry::ToolRegistry, dag: &nexus_interface::dag::DAG, skill_id: u64)
```

#### Function `update_skill_policies`

Replace a skill's payment and schedule policies, advancing its interface revision.

Aborts with \[EAgentNotFound] if the agent is not registered.

```move
public fun update_skill_policies(registry: &mut nexus_registry::agent_registry::AgentRegistry, agent: &mut nexus_interface::agent::Agent, skill_id: u64, payment_policy: nexus_interface::payment::SkillPaymentPolicy, schedule_policy: nexus_interface::agent::SkillSchedulePolicy)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.talus.network/reference/move/nexus_registry/agent_registry.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
