Agent credentials let an Agent authenticate with its communication platform and external services such as GitHub, Jira, Google Workspace, and Pipedrive.
Agent Barn stores credential payloads encrypted, and exposes only non-sensitive metadata after they are saved.
Before you begin
You need:
- Access to the Agent
agent.updatepermission to update its configurationagent.secret.managepermission to add, replace, validate, or remove credentials- Lifecycle permission when applying changes to a running Agent
- A credential with the least privileges required for the Agent’s work
The raw Agent update API accepts configuration changes only while the Agent is stopped. The web interface uses an explicit restart workflow when credentials are changed on a running Agent.
Understand the credential boundaries
Agent Barn has several credential classes with different owners and lifecycles.
| Credential class | Scope | Examples | Managed from |
|---|---|---|---|
| Platform credential | One Agent’s communication platform | Slack bot token, Teams app password, Telegram bot token | Agent configuration |
| Agent integration credential | One Agent and one provider | GitHub PAT, Jira API token, Google refresh token | Agent configuration |
| Shared Credential | One organization, attachable to Agents | Production GitHub, Support Jira | Organization settings |
| User configuration credential | One user | Slack configuration token used to create apps | Personal settings |
| Deployment credential | Agent Barn infrastructure | Encryption key, platform Firecrawl key | Deployment configuration |
Platform credentials
Connect one Agent to its communication platform. Managed in the Agent’s Platform credentials section, never as an ordinary integration Secret.
Per-Agent integration credentials
Give one Agent access to one external provider. At most one credential per provider, entered manually and encrypted at rest.
Shared Credentials
Organization-owned credentials that many Agents can attach by reference, rather than each storing its own copy.
Platform credentials
A Platform credential connects the Agent to its selected communication platform.
| Platform | Credential fields |
|---|---|
| Slack | App-level token and bot token |
| Microsoft Teams | App ID, app password, and tenant ID |
| Telegram | Bot token |
| Discord | Bot token |
These credentials are separate from normal provider integration credentials. A Slack bot token lets the Agent connect to Slack as its communication channel; it is not a manually managed Slack integration Secret.
When a Slack Skill requires Slack access, Agent Barn derives and maintains the corresponding internal integration Secret from the Agent’s Slack bot token.
Slack and Discord bot tokens must be unique across active Agents. Agent Barn rejects a token that is already assigned to another active Agent.
Agent integration credentials
An Agent integration credential, also called an Agent Secret, gives one Agent access to one external provider. An Agent can have at most one credential for each provider.
Agent
├── GitHub credential
├── Jira credential
├── Google Workspace credential
└── Pipedrive credentialFor a given provider, the Agent uses either a manually entered per-Agent credential, or a reference to an Organization Shared Credential. It cannot use both simultaneously.
Credential contents are validated against a provider-specific schema before encryption, and again after decryption.
Shared Credentials
Shared Credentials are encrypted provider credentials owned by an organization. They let administrators create a credential once, and allow organization members to attach it to permitted Agents.
Organization Shared Credential
Production GitHub
│
├── Agent A
├── Agent B
└── Agent CSupported Shared Credential providers are GitHub, Jira, Confluence, Bitbucket, and Zoho Mail.
Any organization member can list and attach available Shared Credentials to Agents they are permitted to configure. Organization Owners and Administrators manage the shared definitions.
See Use shared credentials for the complete lifecycle.
Choose the correct credential boundary
| Requirement | Use |
|---|---|
| Only one Agent needs the provider | Per-Agent integration credential |
| Several Agents should use one manual credential | Shared Credential |
| The provider uses an individual OAuth grant | Per-Agent OAuth credential |
| The credential connects the Agent to Slack, Teams, Telegram, or Discord | Platform credential |
| All Agents use the deployment’s Firecrawl service | Platform Firecrawl configuration |
| One Agent must override the platform Firecrawl key | Per-Agent Firecrawl credential |
| A token is used to create Slack applications for a user | User Slack configuration token |
Use separate provider accounts when Agents need different access boundaries.
Supported integration providers
| Provider | Method | Typical access boundary | Live validation |
|---|---|---|---|
| GitHub | Manual token | Owner and optional repositories | Yes |
| Jira | Email and API token | Atlassian site and account permissions | Yes |
| Confluence | Email and API token | Atlassian site and space permissions | Yes |
| Bitbucket | Email and API token | Workspace and optional repositories | Yes |
| Google Workspace | OAuth | Selected services and access level | Yes |
| Zoho Mail | OAuth client credentials | One Zoho Mail account | Not currently available |
| Firecrawl | API key | Firecrawl Cloud or custom instance | Not currently available |
| Pipedrive | Personal API token | Pipedrive account | Yes |
| Slack | Derived from Platform bot token | Slack workspace and granted bot scopes | Automatic |
| Zoho Calendar | Provider schema exists | Zoho Calendar account | Not offered in the web interface |
Live validation support is separate from schema validation. Every saved payload must match its provider schema, but only providers with a validator can test the credential against the external service.
How credentials reach the Agent
Credential storage and runtime activation are separate phases.
- Stored encrypted credential
- Agent start
- Runtime configuration
- External provider
Enter credential
│
▼
Validate payload shape
│
▼
Encrypt and store
│
▼
Start or restart Agent
│
▼
Decrypt for runtime materialization
│
├── aai-cli profile and secret store
├── gog Google Workspace configuration
├── runtime environment
└── integration policy context
│
▼
External providerThe encrypted database value is the source of truth. Agent Barn decrypts credentials only when required for validation or runtime materialization.
Read APIs return metadata such as the provider, the display label, whether the credential is Shared, and the Shared Credential name and ID where applicable. They do not return the credential content.
Open Keys & integrations
- Open the Agent.
- Go to Configuration.
- Select Keys & integrations.
- Review Platform credentials.
- Review Integration credentials.
Existing credentials appear as configured metadata with their values hidden. A Shared Credential attachment is labeled with the Shared Credential’s name.
Add an integration credential
- Open Keys & integrations.
- Select Edit.
- Go to Integration credentials.
- Select the provider.
- Choose Enter credentials.
- Enter every required field.
- Review the provider’s scope guidance.
- Apply the configuration.
- Restart the Agent if it was running.
- Validate the credential.
- Test a provider-dependent task.
The Agent update replaces or creates the credential for that provider.
Attach a Shared Credential
- Open Keys & integrations, or the Agent’s Skill configuration.
- Select the required provider.
- Choose Use shared credential.
- Select the named Shared Credential.
- Apply the configuration.
- Restart the Agent if needed.
- Validate the attached credential.
- Test the integration.
The Agent stores a reference to the Shared Credential, rather than another copy of its encrypted payload. At Agent start, Agent Barn resolves and decrypts the referenced Organization credential.
An Agent cannot attach a Shared Credential for a provider that already has a manual credential. Remove or replace the manual credential as part of the change.
Add credentials while assigning a Skill
Skills can declare required providers. When assigning a Skill, Agent Barn checks whether the Agent’s resulting credentials cover those providers.
- Assign a Jira Skill The Skill declares its required providers
- Agent Barn checks provider coverage Per-Agent credential, Shared Credential, or a derived Slack credential
- Configure the missing credential The assignment cannot be saved while a required provider is unavailable
The Agent cannot save a Skill assignment when its required provider remains unavailable.
Configure Platform credentials
To rotate or replace a communication-platform credential:
- Open Keys & integrations.
- Select Edit.
- Find Platform credentials.
- Enter the replacement values.
- Leave unrelated fields blank to preserve their existing values.
- Apply the configuration.
- Allow the Agent to restart.
- Verify that the Agent reconnects to its platform.
- Review health and logs.
For Slack, rotate the bot and app-level tokens in the same controlled maintenance window when both changed at the provider.
For Microsoft Teams, keep the App ID, tenant ID, and app password aligned with the same application registration.
Replace or rotate an integration credential
Stored values cannot be retrieved and edited field by field.
- Prepare the complete replacement payload.
- Open the Agent’s integration configuration.
- Select the provider.
- Enter all required fields again.
- Apply the change.
- Restart the Agent.
- Validate the new credential.
- Revoke the old credential at the provider after verification.
A successful per-Agent replacement detaches any Shared Credential previously used for that provider.
Validate a credential
Validation tests an existing credential against its external provider without changing or re-saving it.
- Open Keys & integrations.
- Find the configured integration.
- Select Validate.
- Review the status, identity, missing scopes, or provider error.
Possible results are valid, warning, and invalid. A warning can indicate that authentication succeeded but expected scopes are missing. Validation does not persist changes.
Live validation is not available for every provider. For providers without a validator, use a controlled Agent task and review the resulting logs.
Remove an integration credential
- Stop the Agent, or begin the web interface’s restart-aware edit flow.
- Open Keys & integrations.
- Select Edit.
- Find the configured provider.
- Select Remove.
- Review the resulting Skill requirements.
- Apply the configuration.
- Restart the Agent.
- Confirm that the provider is no longer available.
Agent Barn rejects removal when a remaining assigned Skill requires the provider. To remove a required credential, identify the Skills that require it, confirm that the active Template permits their removal, remove or replace those Skills, remove the credential in the same configuration change where appropriate, then restart and verify the Agent.
Runtime activation
Credential changes take effect in the Agent runtime after a start or restart.
Stopped Agent
Save credential
│
▼
Credential stored
│
▼
Start Agent
│
▼
Runtime receives new configurationRunning Agent
Apply credential change
│
▼
Stop Agent
│
▼
Update encrypted configuration
│
▼
Start AgentGoogle Workspace credentials
Google Workspace uses a separate OAuth flow and the gog CLI. One credential can cover Gmail, Calendar, Drive, and Sheets.
The credential records the Google account email, the selected services, the granted scopes, the refresh token, the read-only or full-access selection, and the OAuth client information.
Changing the selected services or access level requires reconnecting, so Google can grant the correct scopes.
Google Workspace is per-Agent and cannot be attached as a Shared Credential. Continue to Connect Google Workspace for the full setup.
GitHub repository boundaries
A GitHub credential contains a token, an owner or organization, and an optional repository list.
Leaving the repository list empty allows the Agent to address any repository the token itself can access, provided the Agent specifies the repository.
For tighter control:
- Use a fine-grained token.
- Limit it to required repositories.
- Grant only necessary permissions.
- Repeat the repository restriction in Agent Barn.
- Validate and test the intended repository.
The provider’s token permissions remain the ultimate authorization boundary.
Jira and Confluence boundaries
Jira and Confluence credentials inherit the permissions of the Atlassian account associated with the API token.
Agent Barn stores the site URL, the authentication type, the account email, the API token, and the resolved Cloud ID for scoped tokens.
Use an account limited to the intended projects or spaces. Selecting a site URL in Agent Barn does not reduce broader permissions already granted to the Atlassian account.
Firecrawl credentials
Firecrawl can be provided by the Agent Barn deployment. When the platform Firecrawl URL and API key are configured, Agents receive the platform web-fetch and search capability by default.
A per-Agent Firecrawl credential overrides the platform key for that Agent. Use a per-Agent override when:
- The Agent must use Firecrawl Cloud
- The Agent must use another Firecrawl instance
- Separate usage or billing boundaries are required
- The platform credential must not be used
Credential security model
Agent integration credential payloads are:
- Validated against provider-specific schemas
- Serialized as structured JSON
- Encrypted as a single Fernet-encrypted blob
- Revalidated after decryption
- Hidden from read responses
- Materialized only for runtime or validation use
Agent Barn enforces one Agent Secret per provider at the database level. A credential row contains either encrypted per-Agent content, or a Shared Credential reference — never both.
Credential-related event payloads and diagnostic metadata must not contain secret contents.
Permission boundary
Agent credential access follows the Agent access model.
| Action | Required authority |
|---|---|
| See that a provider is configured | Access to the Agent |
| Add or replace a credential | agent.update and agent.secret.manage |
| Remove a credential | agent.update and agent.secret.manage |
| Validate a credential | agent.secret.manage |
| Restart after a change | Lifecycle permission |
| Create or modify a Shared Credential | Organization Owner or Administrator |
| Attach an existing Shared Credential | Access to configure the Agent |
API reference
Read credential metadata
GET /api/v1/organizations/{organization_id}/agents/{agent_id}{
"secrets": [
{
"provider": "github",
"secret_name": "GitHub credential",
"shared_credential_id": null,
"shared_credential_name": null
},
{
"provider": "jira",
"secret_name": "Support Jira",
"shared_credential_id": "3fd08cf5-59c5-494b-9449-a0413109a0ca",
"shared_credential_name": "Support Jira"
}
]
}No content field is returned.
Add or replace a manual credential
The Agent must be stopped.
PATCH /api/v1/organizations/{organization_id}/agents/{agent_id}
Content-Type: application/json{
"secrets": [
{
"provider": "github",
"content": {
"token": "REDACTED",
"owner": "example-org",
"org": "example-org",
"repos": [
"support-api",
"support-web"
]
}
}
]
}Providers not included in secrets remain unchanged. Every credential value in these examples is redacted — supply your own.
Attach a Shared Credential
{
"shared_credentials": [
{
"shared_credential_id": "3fd08cf5-59c5-494b-9449-a0413109a0ca"
}
]
}The Shared Credential must belong to the Agent’s organization.
Remove credentials
{
"removed_secret_providers": [
"github",
"jira"
]
}A provider cannot appear in both secrets and removed_secret_providers in the same request.
Replace Platform credentials
For a stopped Slack Agent:
{
"slack_bot_token": "REDACTED",
"slack_app_token": "REDACTED"
}Only submit platform fields that belong to the Agent’s selected platform.
Validate an integration
POST /api/v1/organizations/{organization_id}/agents/{agent_id}/integrations/{provider}/validateExample:
POST /api/v1/organizations/{organization_id}/agents/{agent_id}/integrations/github/validate{
"validation_status": "valid",
"validation_identity": "example-org",
"validation_error": null,
"missing_scopes": []
}Validation requires agent.secret.manage.
Troubleshooting
I cannot see the existing token
Expected: values are write-only
This is expected. Credential values are write-only and are never returned after storage.
Enter a complete replacement credential when rotation is required.
The API says the Agent must be stopped
Raw updates require a stopped Agent
Raw configuration updates are rejected while an Agent is running. Stop it, submit the update, and start it again.
The web interface provides a restart-aware application flow.
I cannot remove a credential
A Skill still requires the provider
A remaining assigned Skill probably requires that provider.
Remove the Skill, replace it with another compatible configuration, or keep the credential.
I cannot add a Slack integration credential
Slack is derived from the bot token
Slack credentials are derived from the Agent’s Slack Platform bot token and managed automatically.
Update the Slack bot and app-level tokens under Platform credentials.
A Shared Credential conflicts with a manual credential
One source per provider
An Agent can have only one credential source per provider.
Remove or replace the manual credential before attaching the Shared Credential.
Credential validation returns missing scopes
Authentication succeeded, scopes did not
Authentication succeeded, but the provider reports that the credential lacks expected permissions.
Grant only the required missing scopes, rotate or reconnect the credential, and validate again.
The credential validates but the Agent still cannot use it
Check restart, Skills, and boundaries
Check that:
- The Agent was restarted after the change
- The related Skill is assigned
- The Agent pins the expected Skill version
- Provider resources are within the credential’s permission boundary
- Runtime startup completed successfully
- No Skill mount collision occurred
Review Agent health and logs.
Live validation is unavailable
Not every provider has a validator
Not every provider has a live validator. Confirm that the payload saved successfully, restart the Agent, run a controlled provider task, and inspect the logs.
Replacing one field removed another required value
Payloads replace, not merge
Credential replacement uses a complete provider payload. Resubmit all required fields, including non-secret identity and scope fields.
A Slack or Discord token is already in use
Bot tokens must be unique
Bot tokens must be unique across active Agents. Create or rotate to a different provider bot identity.
Removing a credential did not revoke the external token
Revocation happens at the provider
Agent Barn removes its stored access but cannot guarantee revocation at the provider.
Revoke the token through the provider’s administration interface.
Google access stopped after changing services
New consent is required
Changing Google services or read-only status requires another OAuth consent flow. Reconnect Google Workspace with the desired selection.
Recommended practices
- Use a dedicated identity for each production Agent
- Grant the minimum provider scopes required
- Prefer read-only access when writes are unnecessary
- Limit credentials to intended repositories, projects, spaces, or services
- Use Shared Credentials only when Agents should truly share one identity
- Keep OAuth credentials per Agent
- Rotate credentials on a documented schedule
- Validate credentials after creation and rotation
- Restart and test the Agent after every credential change
- Revoke old tokens after confirming the replacement works
- Remove unused credentials promptly
- Never place credentials in Templates, Skills, prompts, memory, or logs
- Restrict
agent.secret.manageto trusted operators - Review Agent access before granting secret-management permission
- Investigate validation warnings and missing scopes rather than granting broad access
Next steps
Continue to Connect Google Workspace to configure a per-Agent OAuth credential for Gmail, Calendar, Drive, and Sheets.