> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runtm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Stripe with a restricted read-only key

> Create Stripe as a custom tool provider, connect it org-wide with a restricted key that can only read, and make a skill require it so sessions receive it. Read when an agent needs charges, payment intents, refunds or disputes and must never move money.

## Outcome

Sessions launched from the agent's template have `STRIPE_SECRET_KEY` set to a key that can read payments data and nothing else, and the Stripe CLI is on the sandbox path.

## Before you start

* You are an admin of the organization, with an org-scoped API key if you use the CLI.
* Stripe is not a built-in provider. If your org went through **Set Up Your First Agent** and picked Stripe, the provider already exists under **Tools & MCP** and you can skip to step 3.
* A skill is attached to the agent's template. Org-wide connections reach a session only when an attached skill asks for the provider.

## Do it

<Steps>
  <Step title="Create a restricted key in Stripe">
    In the Stripe dashboard open **Developers > API keys** and click **Create restricted key**. Grant **Read** on Charges, PaymentIntents, Refunds, Disputes and Customers. Leave every write permission at **None**. Copy the `rk_live_...` value once; Stripe does not show it again.
  </Step>

  <Step title="Define the Stripe provider">
    In **Settings > Context > Tools & MCP** click **New tool or MCP server**, choose **Tool**, then define a custom provider named Stripe in category `sales`. Add one static auth method with a single secret field, `secret_key`, materialized as the environment variable `STRIPE_SECRET_KEY`. Add the Stripe CLI as a package so the agent can run `stripe` commands.
  </Step>

  <Step title="Connect it org-wide">
    Back in **Tools & MCP**, open **Add a provider**, pick Stripe, paste the restricted key, and choose **Teams** so every template in the org can use it.
  </Step>

  <Step title="Make the skill require it">
    Open the agent's runbook skill and add `stripe` to `requires.integrations`. Without this the connection is filtered out of the session, silently.
  </Step>

  <Step title="Rebuild the template">
    Editing the skill triggers a rebuild of the templates it is attached to. If you attached a new skill instead, build once yourself.
  </Step>
</Steps>

## Verify

Launch a session from the template and list one charge. A read succeeds; a write is refused by Stripe with a permissions error.

## Gotchas

* **A full secret key works too, which is the problem.** Nothing in Runtime downgrades a credential. If you paste `sk_live_...`, the agent can refund. Use the restricted key.
* **Connected but not required.** The provider shows as connected under **Tools & MCP**, but `env | grep STRIPE` inside the session is empty. An attached skill must list `stripe` in `requires.integrations`, or the connection must be agent-scoped.
* **Test mode versus live mode.** A restricted key belongs to one mode. Investigations of real customers need a live-mode key; seeded cases in step 5 of Build can run on a test-mode key.

<Card title="3. Give it tools" icon="plug" href="/build/give-it-tools">
  Providers, MCP servers, secrets, and the credential hierarchy that decides which connection a run receives.
</Card>
