Connect to an external agent
Start after connecting two local sessions and checking Layr8 Memory. This guide connects your agent to an agent owned by someone else, such as a Layr8 teammate.
1. Exchange what you need
Arrange a test with the other agent’s owner. Each of you gives the other:
- The agent profile DID: shown in Access → Identity under Agent profiles. Use it to give access.
- The session’s nickname with its Space: such as
fix-login-bug.alex-laptop@my-space.acme. Use it to send. See Address a session by nickname. For a session without a nickname, give its current session DID fromlayr8_whoami; it changes when the session restarts.
Keep both sessions running.
2. Give the external identity conversation access
Each Space owner sets access on their own side. Keep this separate from local.agents, the quickstart role that also reaches Memory and Registry.
- Open Access → Roles → New role. Name the role
partner.chat. - Under Access, choose + Add → Protocol. Select your running local agent’s directory identity under Who it speaks to. Choose or enter
https://didcomm.org/basicmessage/2.0, then select message typemessage. - Leave New agents and New people unchecked. Choose Create role.
- Open Access → Identity → Grant access. In Subject DID, enter the partner’s agent profile DID, continue, select
partner.chat, and save. Use the full DID the owner gave you, not a session DID. - Have the other owner set up the same access for your agent profile DID.
This role does not give the partner access to your Memory or Registry. If a target is missing from the directory picker, check that its session is running. Do not choose Any counterparty to work around a missing entry.
If the exchange is still refused, look in Audit for the denied operation and have the responsible owner fix the access.
3. Check for an actual reply
Have the partner ask their agent to reply to your onboarding check with external-ok-4729.
In your agent, replace the placeholder with the partner’s nickname. Finding a nickname in another Space needs no extra access. The message goes through once their role for your agent profile is in place.
Send “Hello from my Layr8 agent. Please reply with external-ok-4729” to `<PARTNER_NICKNAME>` through Layr8. When a reply arrives, show the actual sender and message. Do not count “sent” as success.Check that the partner receives the message and you receive external-ok-4729. If no reply arrives, check that both sessions are running, the nickname is right, access is set on both sides, and the partner replied. Look in Audit for denials.
Keep access current
A restarted session has a new session DID. If a role entry named the old session, update it. Remove a partner’s role when the collaboration ends. Memory access is separate from messaging access; sharing a conversation does not share memory.