Skip to content

feat: Add Agent Blueprints API support - #1687

Merged
m0tzy merged 1 commit into
mainfrom
devin/1787943065-agent-blueprints
Aug 31, 2026
Merged

feat: Add Agent Blueprints API support#1687
m0tzy merged 1 commit into
mainfrom
devin/1787943065-agent-blueprints

Conversation

@m0tzy

@m0tzy m0tzy commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Description

Adds SDK support for the new Agent Blueprints REST endpoints on the existing Agents module, per the OpenAPI spec committed in workos/workos#70678:

  • Blueprint CRUD: agents.createBlueprint / listBlueprints / getBlueprint / updateBlueprint / deleteBlueprint (/agents/blueprints(/:agent_blueprint_id))
  • Token minting: agents.mintToken (POST /agents/blueprints/:agent_blueprint_id/tokens) — supports user_delegated, autonomous, agent_delegated, and refresh variants; intent is a plain string in the request
  • Agent instances: agents.listInstances / getInstance / deleteInstance (/agents/instances(/:agent_instance_id))
  • Instance sessions: agents.listInstanceSessions / getInstanceSession / revokeInstanceSession (/agents/sessions(/:agent_instance_session_id), POST .../revoke)

List endpoints return AutoPaginatable and follow the existing serializer/deserializer (snake_case ↔ camelCase) conventions. Instance kinds use delegated | autonomous per the spec.

Endpoint status:

  • All endpoints above are documented in workos/workos#70678 (server-side gated by the agent-blueprints-public-api feature flag).
  • POST /agents/blueprints/:id/tokens/validate is NOT included — it is added by the still-unmerged workos/workos#70610 and is not in the docs PR's committed spec.
  • OIDC discovery metadata (workos/workos#69314) does not affect the SDK surface here; no discovery support added.

Tests mirror the existing agents.spec.ts fixture style. npm run lint, npx tsc --noEmit, npm run build, and full Jest suite pass locally.

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[ ] No — docs are covered by workos/workos#70678

Link to Devin session: https://app.devin.ai/sessions/5e94e57d8ee94e0187e2bb46867e3954
Open in Devin Desktop: https://app.devin.ai/desktop/session/5e94e57d8ee94e0187e2bb46867e3954?variant=devin
Requested by: @m0tzy

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@m0tzy
m0tzy requested review from a team as code owners August 28, 2026 18:56
@m0tzy
m0tzy requested a review from mattgd August 28, 2026 18:56
@devin-ai-integration

Copy link
Copy Markdown
Contributor
Original prompt from Devin Bot

Add support for the new WorkOS Agent Blueprints REST endpoints to the workos/workos-node SDK and open a new PR.

Source of truth for the API surface: the docs PR https://github.com/workos/workos/pull/70678 in workos/workos — its committed OpenAPI spec (packages/api/open-api-spec.yaml on that branch) and generated reference pages under packages/docs document the new endpoints. Read that PR's diff/spec carefully rather than guessing shapes.

The endpoint families (all under /agents/blueprints, gated server-side by the agent-blueprints-public-api feature flag):

  • Agent blueprint CRUD: list/create/get/update/delete /agents/blueprints(/:agent_blueprint_id)
  • Agent instances: endpoints under /agents/blueprints/:agent_blueprint_id/instances (list/get/delete etc. per the spec)
  • Agent instance sessions: session endpoints per the spec (list/get/revoke)
  • Token endpoints: POST /agents/blueprints/:agent_blueprint_id/tokens (mint) and POST /agents/blueprints/:agent_blueprint_id/tokens/validate — note validate is added by the still-unmerged https://github.com/workos/workos/pull/70610; include it only if the docs PR spec documents it, and call this out in your PR description.

Important contract details:

  • The token mint request field intent is a plain string in the request, but the minted token claim is an object: intent: { text: string }.
  • Instance kinds use 'autonomous' (NOT 'non_delegated' — that name was renamed; the spec should already say autonomous, flag it to your parent session if you see non_delegated anywhere).
  • Follow the existing SDK conventions in workos-node exactly: module layout, serializers/deserializers, interfaces, pagination (AutoPaginatable), tests mirroring an existing resource module (e.g. look at how organizations or user-management modules are structured).

Process rules:

  • Work only in workos/workos-node. Create a new branch off main, e.g. devin/$(date +%s)-agent-blueprints.
  • Run the repo's lint/typecheck/tests before pushing; open the PR once bas... (456 chars truncated...)

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot changed the title Add Agent Blueprints API support feat: Add Agent Blueprints API support Aug 28, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds Agent Blueprints support to the existing Agents SDK module.

  • Implements blueprint CRUD and token minting.
  • Adds listing, retrieval, deletion, and revocation operations for agent instances and sessions.
  • Introduces public request/response interfaces, snake_case serializers, pagination support, fixtures, and endpoint tests.

Confidence Score: 5/5

The PR appears safe to merge with no concrete changed-code defects identified.

The new endpoint methods, public models, serializers, pagination behavior, and tests are internally aligned with the SDK’s existing service-boundary conventions.

Important Files Changed

Filename Overview
src/agents/agents.ts Adds the Agent Blueprints, token, instance, and session endpoint methods using existing transport and pagination patterns.
src/agents/interfaces/agent-blueprint.interface.ts Defines blueprint resources and create, update, and listing option contracts.
src/agents/interfaces/agent-token.interface.ts Defines token responses and a discriminated request union for all four mint variants.
src/agents/serializers/agent-blueprint.serializer.ts Maps blueprint request and response fields between public camelCase and wire-format snake_case.
src/agents/serializers/agent-token.serializer.ts Serializes each token mint variant and normalizes token responses.
src/agents/agents.spec.ts Covers endpoint paths, HTTP methods, serialized bodies, filters, pagination parameters, and response deserialization.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  App[SDK consumer] --> Agents[workos.agents]
  Agents --> Blueprints[Blueprint CRUD]
  Blueprints --> Tokens[Mint or refresh token]
  Tokens --> Instances[Agent instances]
  Instances --> Sessions[Instance sessions]
  Sessions --> Revoke[Revoke session]
Loading

Reviews (1): Last reviewed commit: "Add Agent Blueprints API support" | Re-trigger Greptile

@m0tzy
m0tzy merged commit 364e223 into main Aug 31, 2026
8 of 9 checks passed
@m0tzy
m0tzy deleted the devin/1787943065-agent-blueprints branch August 31, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants