Skip to main content

Crate acp_runtime

Crate acp_runtime 

Source
Expand description

§ACP — Agent Communication Protocol

ACP (Agent Communication Protocol) is a secure, identity-driven protocol for autonomous systems to communicate, discover each other, and collaborate across environments.

Unlike traditional APIs or message brokers, ACP is designed for communication between autonomous systems and agents with:

  • identity-based addressing
  • signed and verifiable messages
  • transport independence (HTTP, AMQP, MQTT)
  • optional relay-based routing

§What this crate provides

This crate is the Rust runtime for ACP, allowing you to:

  • create and manage agent identities
  • send and receive ACP messages
  • integrate with relays and transports
  • build autonomous systems using a consistent protocol

This crate is intended for building ACP-compatible agents and integrations in Rust.

§Quick example

use acp_runtime::AcpAgent;
use serde_json::json;

let mut agent = AcpAgent::load_or_create("agent:demo", None)?;

agent.send_basic(
    vec!["agent:other".into()],
    serde_json::from_value(json!({ "message": "hello" }))?,
    Some("ping".into()),
)?;

§Interoperability

ACP agents written in different languages (Python, TypeScript, Rust, Java) can communicate seamlessly using the same protocol semantics.

§Mental model

  • HTTP is for services
  • ACP is for agents

§More information

ACP is part of a multi-language ecosystem, with compatible runtimes in Python, TypeScript, Mojo, Go and Java.

  • GitHub: https://github.com/beltxa/acp
  • Protocol overview: see repository README

Re-exports§

pub use agent::AcpAgent;
pub use agent::CapabilityRequestResult;
pub use agent::DecryptedMessage;
pub use agent::InboundResult;
pub use amqp_transport::AmqpMessageHandler;
pub use amqp_transport::AmqpTransportClient;
pub use amqp_transport::DEFAULT_AMQP_EXCHANGE;
pub use amqp_transport::DEFAULT_AMQP_EXCHANGE_TYPE;
pub use capabilities::AgentCapabilities;
pub use capabilities::CapabilityMatch;
pub use constants::ACP_IDENTITY_VERSION;
pub use constants::ACP_VERSION;
pub use constants::DEFAULT_CRYPTO_SUITE;
pub use constants::TRUST_PROFILES;
pub use discovery::DiscoveryClient;
pub use errors::AcpError;
pub use errors::AcpResult;
pub use errors::FailReason;
pub use identity::AgentIdParts;
pub use identity::AgentIdentity;
pub use identity::IdentityBundle;
pub use key_provider::IdentityKeyMaterial;
pub use key_provider::KeyProvider;
pub use key_provider::KeyProviderInfo;
pub use key_provider::LocalKeyProvider;
pub use key_provider::TlsMaterial;
pub use key_provider::VaultKeyProvider;
pub use messages::AcpMessage;
pub use messages::CompensateInstruction;
pub use messages::DeliveryMode;
pub use messages::DeliveryOutcome;
pub use messages::DeliveryState;
pub use messages::Envelope;
pub use messages::MessageClass;
pub use messages::ProtectedPayload;
pub use messages::SendResult;
pub use messages::WrappedContentKey;
pub use mqtt_transport::DEFAULT_MQTT_QOS;
pub use mqtt_transport::DEFAULT_MQTT_TOPIC_PREFIX;
pub use mqtt_transport::MqttMessageHandler;
pub use mqtt_transport::MqttTransportClient;
pub use options::AcpAgentOptions;
pub use overlay::OverlayInboundAdapter;
pub use overlay::OverlayOutboundAdapter;
pub use overlay::OverlaySendResult;
pub use overlay::OverlayTarget;
pub use overlay_framework::OverlayClient;
pub use overlay_framework::OverlayConfig;
pub use overlay_framework::OverlayFrameworkRuntime;
pub use overlay_framework::OverlayHttpResponse;
pub use overlay_framework::WELL_KNOWN_CACHE_CONTROL;

Modules§

agent
amqp_transport
capabilities
constants
crypto
discovery
errors
http_security
identity
json_support
key_provider
messages
mqtt_transport
options
overlay
overlay_framework
transport
well_known