What are Agent Keys?
An Agent Key is a unique identifier for an agent instance. It’s used in SDK calls to identify which agent instance is sending events.Getting Your Agent Key
- Log in to the Valmi Value Control Plane
- Navigate to Agents → Select an agent → Instances
- Create or select an instance
- Copy the Agent Key
Using Agent Keys
Use the agent key in SDK calls:Environment-Based Keys
Use different keys for different environments:Key Mapping
The Control Plane maps agent keys to:- Agent Instance: Which instance the key belongs to
- Pricing Rules: Instance-specific pricing
- Cost Allocation: How costs are attributed
- Subscriptions: Which customer subscription (if any)
Key Rotation
Periodically rotate agent keys for security:- In the Control Plane, navigate to the instance
- Click Rotate Key
- New key is generated
- Old key is invalidated (with 24-hour grace period)
- Update your code with the new key
There’s a 24-hour grace period where both old and new keys work, giving you time to update your code.
Multiple Instances
Use different keys for different instances:Key Validation
The SDK validates agent keys:- Format Check: Validates key format
- Existence Check: Verifies key exists (on first use)
- Status Check: Ensures key is active
Best Practices
- Store Securely: Use environment variables or secret management
- Rotate Regularly: Rotate keys every 90 days
- Use Different Keys: Separate keys for different environments
- Monitor Usage: Track key usage in the Control Plane