Stripe plugin
Bring Stripe's own agent toolkit into Noir and layer explicit approval and retry policy over its tools.
Stripe creates the client and tools. Noir packages them as a plugin so namespacing, policy, and cleanup are consistent with the rest of the agent.
npm install @stripe/agent-toolkitimport { stripe } from '@noir-agent/agent/plugins/stripe'
import { createStripeAgentToolkit } from '@stripe/agent-toolkit/ai-sdk'
const toolkit = await createStripeAgentToolkit({
secretKey: process.env.STRIPE_RESTRICTED_KEY!,
configuration: {},
})
export default noir({
// ...
plugins: [
stripe({
toolkit,
policy: {
'refund*': { approval: 'requester', retry: 'idempotent' },
},
}),
],
})Tool ownership
The plugin calls toolkit.getTools() and namespaces the resulting tools under stripe. It does not recreate the Stripe SDK or ask users to configure Stripe through a Noir service. On agent shutdown it calls toolkit.close().
Credentials
Use a restricted key with only the operations the agent needs. A policy rule does not compensate for a secret key that can perform unrelated administrative actions.
Policy
Plugin patterns are scoped automatically, so refund* becomes stripe.refund*. Agent-level policy can override the assembled rule. Review the actual tool names returned by the installed toolkit version; do not assume a wildcard matches an operation that was renamed.
Idempotency
Requester approval determines whether the operation may proceed. Provider idempotency determines whether a retry duplicates it. Ensure write tools pass Noir's stable idempotency key through the toolkit or wrap the affected tool when the provider integration does not.
Pin and test the toolkit version because the provider controls tool schemas and behavior.