Integrations
Concept

Use shared credentials

Create Organization-owned provider credentials and reuse them across permitted Agents.

For
Organization owners, Organization administrators, and Agent operators
On this page
  1. What is a Shared Credential?
  2. When to use one
  3. Supported providers
  4. Roles and permissions
  5. Before you begin
  6. Create a Shared Credential
  7. Attach it to an Agent
  8. Replace an Agent credential
  9. Verify the connection
  10. Rotate a Shared Credential
  11. Detach or delete a credential
  12. Runtime behavior
  13. API reference
  14. Troubleshooting
  15. Security considerations
  16. Next steps
  • Shared Credentials
  • Organization security
  • 12 minutes

Create one encrypted provider credential and reuse it across multiple permitted Agents in the same Organization.

What is a Shared Credential?

A Shared Credential is an encrypted, provider-specific credential owned by one Organization. Instead of storing another copy of the provider token on each Agent, Agent Barn stores a reference from the Agent to the Shared Credential.

Organization → Production GitHub (encrypted)
  • Referenced by Agent A
  • Referenced by Agent B
  • Referenced by Agent C

The diagram shows a single Organization-owned credential named Production GitHub. Agent A, Agent B, and Agent C each store a reference to that one encrypted credential. The credential content is not copied into any of the three Agents.

When an Agent starts, Agent Barn follows the reference, decrypts the credential, and materializes the provider configuration the Agent runtime needs.

Credential plaintext is never returned through Shared Credential read APIs. Members can see metadata such as the name, the provider, and the number of attached Agents — but never the stored token or password.

When to use one

Use a Shared Credential

  • Multiple Agents should use the same provider identity
  • Organization administrators should own credential rotation
  • Every attached Agent can safely share the same permissions and quota
  • You want to avoid entering the same token separately for every Agent
  • The provider account represents an Organization-owned automation identity

Use a per-Agent credential

  • Only one Agent needs the provider
  • Each Agent needs separate provider permissions
  • You need separate billing, quotas, or audit identities
  • The credential belongs to an individual user
  • The provider is not supported by Shared Credentials
  • Compromise of one Agent should not affect other Agents

Supported providers

Shared Credentials currently support manual-entry credentials for these providers:

Provider Provider identifier Credential type
GitHub github Personal access token and optional repository defaults
Jira jira Atlassian account email and API token
Confluence confluence Atlassian account email and API token
Bitbucket bitbucket Account email, API token, workspace, and optional repository defaults
Zoho Mail zoho_mail OAuth client credentials and refresh token

You can create multiple credentials for one provider. For example:

Credential names
Production GitHub
Staging GitHub
Read-only GitHub
Finance Jira
Engineering Jira

Shared Credential names must be unique across the entire Organization, even when the credentials use different providers.

Roles and permissions

Shared Credential management and Agent attachment use different authorization boundaries. The Scope column names which boundary each action is checked against.

Action Required authority Scope
List Shared Credentials Accepted Membership in the Organization Organization
View Shared Credential metadata Accepted Membership in the Organization Organization
Create a Shared Credential Organization Owner or Administrator Organization
Edit or rotate a Shared Credential Organization Owner or Administrator Organization
Run live validation Organization Owner or Administrator Organization
Delete a Shared Credential Organization Owner or Administrator Organization
Attach or detach one from an Agent Access to the Agent with agent.update and agent.secret.manage Agent
Use one while creating an Agent Permission to create the Agent and use the Organization resource Agent

Attaching a Shared Credential to an Agent is not an Organization action alone. It also requires permission to update that Agent and to manage its secrets: agent.update and agent.secret.manage.

Organization Owners and Administrators hold implicit Agent Owner authority over Agents in their Organization. An Organization Member normally needs Agent Editor, Agent Owner, or a custom access role that grants both required permissions. An Agent Viewer cannot attach, replace, or remove credentials.

Before you begin

Make sure you have:

  • An accepted Membership in the correct Organization
  • Organization Owner or Administrator authority, if you are creating the credential
  • A provider credential with the minimum required permissions
  • Access to at least one Agent for testing
  • agent.update and agent.secret.manage on the target Agent
  • The ability to stop the Agent before changing its credential assignment

Review the provider-specific guide before creating the credential:

Create a Shared Credential

Only an Organization Owner or Administrator can complete this procedure.

1. Open Organization settings

Select the Organization, open Settings, and select Shared Credentials. This page lists credentials belonging only to the active Organization.

2. Select Connect credential

Select Connect credential to open the new credential drawer.

3. Choose a provider

Select one of the supported providers: github, jira, confluence, bitbucket, or zoho_mail.

4. Enter a descriptive name

Use a name that helps operators distinguish the credential’s environment, owner, or authorization boundary — for example Production GitHub, Staging Bitbucket, or Support Zoho Mail.

Names must contain between 1 and 255 characters, and must be unique across the Organization.

5. Enter the provider fields

Complete every required provider field. Agent Barn validates the payload against the selected provider’s schema before encrypting it.

Repository lists are optional for GitHub and Bitbucket. Leaving them empty does not narrow the provider token’s own permissions; it means the Agent must identify the repository when it uses the integration.

6. Create the credential

Select Create credential. Agent Barn then displays the name, the provider, the number of attached Agents, and creation and update metadata. It does not display the stored credential content.

Attach it to an Agent

Any accepted Organization Member can see the available Shared Credentials, but saving the assignment requires permission to update and manage secrets on that Agent.

1. Stop the Agent

Open the target Agent and stop it if it is running. Agent Barn rejects Agent configuration updates while the Agent is running.

2. Open the Agent’s integrations

Open the Agent configuration and find the provider under its Skills or integrations section.

3. Select Use shared credential

For a supported provider, choose Use shared credential. The alternative is Enter credentials, which stores a manual credential on that Agent alone.

4. Select the credential

Choose an Organization Shared Credential from the provider-filtered list. Only credentials created for the same provider appear — a GitHub integration cannot reference a Jira Shared Credential.

5. Save and start the Agent

Save the Agent configuration and start the Agent. At startup, Agent Barn resolves the reference, decrypts the Shared Credential, and builds the same provider runtime configuration it would build for a manual Agent credential.

6. Test the provider

Give the Agent a small, read-only task against a known resource. Confirm both:

  • A resource the Agent should be able to access
  • A resource the Agent should not be able to access

This verifies the provider’s authorization boundary — not merely that the token is accepted.

Replace an Agent credential

An Agent can have at most one credential source for each provider.

  • Allowed A manual Agent credential for the provider
  • Allowed A Shared Credential reference for the provider
  • Not allowed A manual credential and a Shared Credential for the same provider

Switch from a manual credential to a Shared Credential

  1. Stop the Agent.
  2. Open the provider configuration.
  3. Select Use shared credential.
  4. Choose the Shared Credential.
  5. Save the Agent.
  6. Start the Agent and verify it.

The manual credential must be removed as part of the switch.

Switch between Shared Credentials

  1. Stop the Agent.
  2. Open the provider configuration.
  3. Select the replacement Shared Credential.
  4. Save the Agent and restart it.
  5. Verify the new provider identity and access boundary.

The Agent keeps one provider slot and changes which Shared Credential it references.

Switch to a manual credential

  1. Stop the Agent.
  2. Select Enter credentials.
  3. Complete all provider fields.
  4. Save the Agent and restart it.
  5. Verify the new credential.
  6. Revoke the former provider credential only if no other Agent still uses it.

Verify the connection

Organization Owners and Administrators can open a Shared Credential and select Validate. Live validation is available for GitHub, Jira, Confluence, and Bitbucket.

Result Meaning
valid The provider accepted the credential.
warning The credential is valid, but expected permissions may be missing.
invalid Authentication or provider checks failed.
unsupported No live validator exists for the provider.

Zoho Mail currently returns an unsupported live-validation result:

Response
{
  "validation_status": "unsupported",
  "validation_identity": null,
  "validation_error": "Live validation is not available for this provider",
  "missing_scopes": []
}

For every provider, the authoritative end-to-end check is still a task performed by a restarted Agent. Live validation does not prove that the Agent’s selected resources, repository defaults, Skills, or runtime configuration are correct.

Rotate a Shared Credential

Updating one Shared Credential changes the stored source used by every attached Agent. It does not automatically restart those Agents.

  1. Identify affected Agents Open the Shared Credential and review its Used by count. Record the Agents that reference it before you begin. The metadata reports a count; credential plaintext stays hidden.
  2. Create the replacement provider key Create a new token or refresh token at the provider and grant only the required permissions. Keep the previous credential active during the rollout.
  3. Update the Shared Credential Open the credential, select Edit credential, and enter the complete replacement payload.
  4. Restart attached Agents Stop and start each affected Agent so its runtime receives the updated credential. Agents that keep running continue to use the configuration materialized at their previous start.
  5. Verify each authorization boundary Run a small provider task from every affected Agent. Test permitted and prohibited resources where practical.
  6. Revoke the previous provider key Revoke the old key only after all affected Agents have restarted and passed verification.

Detach or delete a credential

Detach it from an Agent

  1. Stop the Agent.
  2. Open its provider configuration.
  3. Remove the provider, or switch to another credential source.
  4. Save the Agent.
  5. Restart the Agent and verify it.

If an assigned Skill requires the provider, Agent Barn may block the removal. Provider-dependent Skill requirements must remain satisfied, so replace the provider credential or remove the dependent Skill as part of a valid configuration change.

Delete it from the Organization

A Shared Credential cannot be deleted while any non-deleted Agent references it. To delete it:

  1. Review the attached Agent count.
  2. Detach or replace the credential on every affected Agent.
  3. Return to Organization settingsShared Credentials.
  4. Open the credential.
  5. Select Delete.
  6. Confirm the deletion.

If an Agent still references the credential, Agent Barn returns a conflict similar to:

Conflict message
Shared credential is attached to 3 agent(s). Detach it from all agents before deleting.

Runtime behavior

At Agent start, Agent Barn:

  1. Loads the Agent’s provider slots.
  2. Identifies the slots that reference Shared Credentials.
  3. Confirms each credential belongs to the Agent’s Organization.
  4. Decrypts the provider-specific content.
  5. Revalidates its schema.
  6. Builds the runtime profile and secret-store configuration.
  7. Mounts eligible built-in provider Skills.
  8. Adds the integration policy to the rendered Agent configuration.

The runtime receives the provider content, not the Shared Credential management API.

Updating a Shared Credential therefore affects future Agent starts. It does not dynamically replace secrets inside an Agent that is already running.

API reference

List Shared Credentials

HTTP
GET /api/v1/organizations/{organization_id}/shared-credentials?page=1&page_size=15

Optional filters:

Query parameters
search=Production
provider=github

The response includes metadata and agent_count, but never content.

List attachment options

HTTP
GET /api/v1/organizations/{organization_id}/shared-credentials/briefs
Response
[
  {
    "id": "018f0000-0000-7000-8000-000000000001",
    "provider": "github",
    "name": "Production GitHub"
  }
]

Create a Shared Credential

HTTP
POST /api/v1/organizations/{organization_id}/shared-credentials
Content-Type: application/json
Request body
{
  "provider": "github",
  "name": "Production GitHub",
  "content": {
    "token": "REDACTED",
    "owner": "agent-barn",
    "org": "agent-barn",
    "repos": [
      "agent-barn"
    ]
  }
}
Response
{
  "id": "018f0000-0000-7000-8000-000000000001",
  "organization_id": "018f0000-0000-7000-8000-000000000002",
  "provider": "github",
  "name": "Production GitHub",
  "created_by": "018f0000-0000-7000-8000-000000000003",
  "agent_count": 0,
  "created_at": "2026-08-29T10:00:00Z",
  "updated_at": "2026-08-29T10:00:00Z"
}

The response does not include content.

Attach it to an Agent

The Agent must be stopped.

HTTP
PATCH /api/v1/organizations/{organization_id}/agents/{agent_id}
Content-Type: application/json
Request body
{
  "shared_credentials": [
    {
      "shared_credential_id": "018f0000-0000-7000-8000-000000000001"
    }
  ]
}

Replace a manual credential with a Shared Credential

Remove the existing provider slot and attach its replacement in the same Agent update:

Request body
{
  "removed_secret_providers": [
    "github"
  ],
  "shared_credentials": [
    {
      "shared_credential_id": "018f0000-0000-7000-8000-000000000001"
    }
  ]
}

Detach it from an Agent

Detachment is expressed by provider through removed_secret_providers:

Request body
{
  "removed_secret_providers": [
    "github"
  ]
}

Rename a Shared Credential

HTTP
PATCH /api/v1/organizations/{organization_id}/shared-credentials/{credential_id}
Content-Type: application/json
Request body
{
  "name": "Production GitHub — read only"
}

Renaming does not require the credential content, and does not replace the stored payload.

Replace credential content

Submit the complete provider payload:

Request body
{
  "content": {
    "token": "REDACTED_NEW_TOKEN",
    "owner": "agent-barn",
    "org": "agent-barn",
    "repos": [
      "agent-barn"
    ]
  }
}

The provider cannot be changed through this endpoint.

Validate a Shared Credential

HTTP
POST /api/v1/organizations/{organization_id}/shared-credentials/{credential_id}/validate
Content-Type: application/json
Request body
{}

Delete a Shared Credential

HTTP
DELETE /api/v1/organizations/{organization_id}/shared-credentials/{credential_id}

A successful deletion returns HTTP 204. An attached credential returns HTTP 409.

Troubleshooting

Symptom Likely cause Resolution
Connect credential is unavailable You are not an Organization Owner or Administrator Ask an Organization Owner or Administrator to create the credential.
The Shared Credential is not shown for an Agent Its provider does not match the selected integration Select a credential created for the same provider.
No credentials are available to select No supported credential exists in the active Organization Confirm the active Organization and ask an administrator to create one.
HTTP 400 reports an unsupported provider The selected provider is not eligible for Shared Credentials Use a per-Agent credential or the provider’s documented configuration path.
A duplicate-name error appears Another Shared Credential in the Organization already uses that name Choose a unique name, even when the providers differ.
An update is rejected for missing fields Credential-content changes require the complete provider payload Re-enter every provider field, or submit only the name when renaming.
The Agent already has a manual credential One provider cannot use a manual credential and a Shared Credential at the same time Switch credential modes, or remove the manual credential in the same update.
The update is refused because the Agent must be stopped Agent configuration cannot change while the Agent is running Stop the Agent, update the assignment, and restart it.
Detachment is rejected because a Skill requires the provider The remaining Agent configuration would not satisfy the assigned Skill Attach a replacement credential, or remove the dependent Skill when that is allowed.
Deletion returns HTTP 409 A non-deleted Agent still references the credential Detach it from every Agent before deleting it.
Validation reports unsupported The provider has no live validator Run an end-to-end task through a restarted Agent instead.
A rotated token validates but fails on an Agent The Agent has not restarted since the rotation Stop and start the Agent to rematerialize its runtime configuration.
An Agent still acts as the old provider identity Its running runtime was built before the update Restart the Agent and repeat the provider identity test.
Access returns HTTP 404 from another Organization Shared Credentials are isolated to the Organization that owns them Switch to the owning Organization. Credentials cannot be attached across Organizations.
A scoped Atlassian runtime profile reports a missing Cloud ID The stored Shared Credential lacks the resolved Atlassian Cloud ID the runtime needs Use a supported non-scoped token, or a per-Agent Atlassian credential, until the deployment persists Cloud IDs for shared scoped tokens.

Security considerations

Follow these practices:

  • Create dedicated automation identities instead of sharing personal credentials
  • Grant the minimum provider permissions required
  • Separate production, staging, and development credentials
  • Use different credentials for Agents with different authorization boundaries
  • Keep repository and workspace defaults narrow
  • Test both allowed and prohibited resources after every change
  • Avoid sensitive information in Shared Credential names
  • Remember that all accepted Organization Members can list credential metadata
  • Restrict Agent Secret management through Agent access roles
  • Rotate credentials regularly, and immediately after suspected exposure
  • Restart every attached Agent after a rotation, because the runtime receives content only at start
  • Revoke old provider keys only after verification
  • Monitor provider audit logs for actions performed by the shared identity
  • Do not place provider secrets in Templates, Skills, Agent prompts, or source control
  • Back up the Agent Barn encryption key according to your deployment policy, because losing it makes encrypted credential payloads unreadable
  • Treat encryption-key rotation as a credential migration, not a normal provider-token update

Shared Credentials are also isolated by Organization. A credential owned by one Organization is not readable or attachable from another, even by a user who belongs to both.

Next steps

After creating and attaching a Shared Credential:

  1. Validate the credential where live validation is supported.
  2. Restart each attached Agent.
  3. Test permitted and prohibited provider resources.
  4. Record the credential owner and rotation schedule.
  5. Review the number of attached Agents regularly.
  6. Continue to Manage organizations and members.
Documentation