Working with Your Ledger Environment: Instances, Cohorts, Roles, and Agents
Now that your CLI is connected and authenticated, this guide walks you through the first operational steps in your Ledger environment: defining roles, creating agents, and understanding how to scope access using instances and cohorts.
What Is an Instance?
An instance is how your CLI connects to your assigned Ledger environment (e.g., your test or production setup). You’ll typically be given the base URL for your Ledger instance during onboarding.
A cohort is a workspace or namespace inside the ledger. Your cohort is assigned during onboarding and defines the scope of your agents, roles, and operations.
Cohort paths follow the format /application/<name>
1. Define a Role
A role defines what an agent is allowed to do. Each role includes:
A name (e.g. ADMIN)
A set of permissions:
read – View data
write – Modify data
transition – Move items between lifecycle states
access – Connect to services
impersonate – Allow one agent to act on behalf of another
Create a full-access role:
2. Create an Agent
An agent is an identity that interacts with the ledger via API, CLI, or automation. Agents are created within a cohort.
Set your auth identity (i.e., who the CLI is acting as). This must match a registered agent in your cohort and is used for all requests in your current session.
Then create an agent:
💡 Agent Naming Tip:
Use application/<name> for your app or employee/<user-id> for individuals.
Example: application/finance-app, employee/charlie.wei
3. View and Test Your Setup
List all agents in your cohort:
Example output:
This means there’s an agent admin in the application cohort with ADMIN permissions.
4. Common Customizations
Create a limited-access role:
Register an agent with that role:
🛠 Troubleshooting
Problem
Fix
No agents found
Ensure you've set the instance: luca configure default-instance
Invalid cohort
Use /application/<name> instead of /service/
Permission denied
Check your role permissions and assigned roles
Now that you have agents and roles configured, you're ready to: