What is a Service Account?
A Service Account is a special principal type (distinct from Users) that represents an application or automated system. Benefits:- No Login Required - Uses API keys instead of passwords
- Fine-Grained Control - Assign only the capabilities needed
- Audit Trail - All actions credited to the service account
- Revocable Access - Instantly disable without affecting users
- Scalable - One service account can power many integrations
Creating a Service Account
Configure Service Account
Fill in:
- Name - Unique identifier (e.g., “github-actions-bot”)
- Description - What this account does (e.g., “Deploy agents from CI/CD”)
- Role - Same as team roles (Owner, Admin, Developer, Viewer)
Save and Generate API Key
Click Create. You’ll immediately be shown an API key:Save this key immediately - it won’t be shown again. Store it securely in:
- GitHub Secrets
- Environment variables
- Secret manager (e.g., HashiCorp Vault, 1Password)
API Key Format
API keys follow the format:- Prefix (
ak-) - Identifies it as an API key - Access ID — 32 hex characters (UUID without hyphens)
- Secret — Private credential appended directly after the access ID (never displayed again)
Managing Service Accounts
Disable/Enable
Temporarily disable a service account without deleting it:- Go to Team > Service Accounts
- Click on the service account
- Toggle Enabled switch
- Click Save
Delete Service Account
Permanently remove a service account:- Go to Team > Service Accounts
- Click on the service account
- Click Delete at the bottom
- Confirm deletion
View Activity
See what each service account has done:- Go to Team > Service Accounts
- Click on the service account
- View Activity tab
- See recent API calls, errors, and timestamps
Assigning Permissions
Service Accounts inherit roles like team members:| Role | Best For |
|---|---|
| Owner | Only if account-level changes needed (rare) |
| Admin | Manage infrastructure, deploy agents |
| Developer | Create/modify agents and capabilities |
| Viewer | Read-only access, monitoring |
Resource-Level Restrictions
Like team members, service accounts can be restricted to specific resources:- Open a resource (agent, gateway, capability)
- Click Settings > Access Control
- Toggle Restricted Access
- Add the service account
- Click Save
Using Service Accounts in Code
JavaScript/Node.js
Python
Bash/cURL
GitHub Actions
API Key Rotation
Rotate keys periodically for security:- Create a new API key (old one still works)
- Update all applications to use the new key
- Once all applications updated, delete the old key
- Monitor logs to confirm no old key usage
Automated Rotation
- Go to Team > Service Accounts > Select account
- Click API Keys tab
- Click Enable Auto-Rotation
- Set rotation period (e.g., 90 days)
- Configure notification preferences
Security Best Practices
Key Storage
- Store in environment variables, not code
- Use a secret manager (e.g., HashiCorp Vault, 1Password)
- Encrypt at rest if stored in config files
- Never commit keys to version control
Least Privilege
- Create separate service accounts for each integration
- Assign only the role needed
- Use resource-level restrictions when possible
- Regularly audit what each account accesses
Monitoring
- Enable activity logging
- Alert on failed authentication attempts
- Review service account activity monthly
- Disable unused service accounts
Rotation
- Rotate keys at least annually
- Rotate immediately if key is compromised
- Use automated rotation for high-risk accounts
- Test rotation before deploying
Troubleshooting
”Unauthorized” Error
- Check API key is correct and not expired
- Verify service account is enabled
- Ensure service account has permission for that resource
- Check key hasn’t been rotated recently
Service Account Can’t Access Resource
- Check service account role is Developer or higher
- If resource is restricted, confirm service account is listed
- Verify service account hasn’t been disabled
Lost API Key
- Delete the old key
- Generate a new one
- Update all applications using the old key
- Confirm old key no longer works before decommissioning