Developer docs · Browse & search
BUILD
Models, secrets and configuration
Connect a model provider, keep secrets for tools and webhooks, and share configuration with agents.
Connecting a model
ts
const provider = await jwtson.providers.register({ service: 'anthropic', model: 'claude-opus-5-5' });
provider.needs; // What's left: ['policy'], say
await provider.enable(); // Lets agents in this environment use it
const agent = await jwtson.agents.create({ name: 'Helper', instructions: 'Be useful.', model: provider, tools: ['lookup_order'], skills: ['Refunds'] });The address and protocol follow from service. Two things can't be done from here, deliberately:
- An environment owner approves the connection. Until then registering throws, and the message gives the commitment they approve.
- A provider's key is never sent through the API. An operator installs it in the broker against
provider.credentialBindingId.
Secrets
Keys that tools and webhook destinations sign in with. They can be written and never read back.
ts
const secret = await jwtson.secrets.get('Billing API');
await secret.replace(newKey); // Checked before it takes over. If that fails, the old one stays
await secret.disable();Configuration, webhooks and grants
ts
await jwtson.configuration.ensure('billing', { region: 'eu', retries: 3 }, { visibleToAgents: ['region'] });
const hook = await jwtson.webhooks.request({ name: 'Partner', url: 'https://partner.example/hook', authentication: 'bearer' });
await hook.approve({ review: 'automatic', retriesSafe: true, secret: partnerKey });
await jwtson.grants.create({ to: personId, operation: 'tools:use', resource: toolId });
await jwtson.audit(50); // What's happened here
await run.milestones().toArray(); // What the run reported
await run.plans().toArray(); // What it committed toFrom the @jwtson/sdk README, as the code stands.