Skip to content

feat(generated): Changes to agents, directory_sync, sso, and 2 more services - #783

Open
workos-sdk-automation[bot] wants to merge 6 commits into
mainfrom
oagen/batch-880b6f9a
Open

workos-sdk-automation[bot] wants to merge 6 commits into
mainfrom
oagen/batch-880b6f9a

Conversation

@workos-sdk-automation

@workos-sdk-automation workos-sdk-automation Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

feat(agents)!: Change agents API surface

  • SDK surface change: Parameter type changed for "permissions" on "Agents.create_blueprint".
  • SDK surface change: Parameter type changed for "permissions" on "Agents.update_blueprint".

feat(directory_sync)!: Change directory sync API surface

  • SDK surface change: Symbol "DirectorySync.get_directory_group" was removed.
  • SDK surface change: Symbol "DirectorySync.get_directory_user" was removed.
  • SDK surface change: Symbol "DirectorySync.list_directory_groups" was removed.
  • SDK surface change: Symbol "DirectorySync.list_directory_users" was removed.

feat(sso): Add SSO API surface

  • Added model ConnectionSAMLCertificateReplaced.
  • Added model ConnectionSAMLCertificateReplacedData.
  • Added model ConnectionSAMLCertificateReplacedDataConnection.
  • Added model ConnectionSAMLCertificateReplacedDataCertificate.
  • Added enum ConnectionSAMLCertificateReplacedDataCertificateCertificateType.

feat(webhooks): Add webhook API surface

  • Added connection.saml_certificate_replaced to CreateWebhookEndpointEvents.
  • Added connection.saml_certificate_replaced to UpdateWebhookEndpointEvents.

fix(events): Updated model EventSchema

  • Updated model EventSchema.

Triggered by workos/openapi-spec@ddc0648

BEGIN_COMMIT_OVERRIDE
feat(agents): Change agents API surface (#783)
feat(directory_sync): Change directory sync API surface (#783)
feat(sso): Add SSO API surface (#783)
feat(webhooks): Add webhook API surface (#783)
fix(events): Updated model EventSchema (#783)
END_COMMIT_OVERRIDE

…iKeys, AuditLogs, Authorization, ClientApi, Connect, DirectorySync, Events, FeatureFlags, Groups, MultiFactorAuth, OrganizationDomains, OrganizationMembership, Organizations, OrganizationsIssuerTrusts, Pipes, PipesProvider, PlatformTeams, Radar, SSO, UserManagement, Vault, Webhooks, Widgets
@workos-sdk-automation
workos-sdk-automation Bot requested a review from a team as a code owner November 24, 2026 18:45
@workos-sdk-automation workos-sdk-automation Bot added the autogenerated Autogenerated code or content label Nov 24, 2026
@gjtorikian gjtorikian changed the title feat(generated)!: Changes to agents, directory_sync, sso, and 2 more services feat(generated): Changes to agents, directory_sync, sso, and 2 more services Nov 24, 2026
@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 3/5

[High impact] The SDK adds calls that can change organization access and accepted identity issuers.

Fix the agent permission and Radar list conversions before merging.

Findings

  1. P1 Typed permissions cannot be sent ▶
  2. P1 Matched lists have wrong types ▶
Fix with agent prompt
### Issue 1
src/workos/agents/_resource.py:98
Passing an `AgentBlueprintsCreateRequestPermission` in `permissions` raises `TypeError` before the request is sent. `create_blueprint` puts the objects straight into the body, but the JSON encoder cannot convert them. The same problem affects `update_blueprint`, both async methods, and both request models.

Convert permission objects with `to_dict()` while keeping string entries unchanged. Both request models also need to build typed permission objects in `from_dict()`.

### Issue 2
src/workos/common/models/radar_detection_domain_protections_details.py:38
`also_matched_lists` promises `RadarDetectionList` objects, but `from_dict()` leaves its entries as dictionaries. When another list matched, reading `get_detection(...).evidence.details.also_matched_lists[0].name` raises `AttributeError`. In the other direction, `to_dict()` leaves typed entries as model objects rather than dictionaries.

Convert each non-null entry in both directions, preserving null entries for deleted lists. Add a test that checks the entry type; dictionary round trips hide this bug.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Expands the SDK with scoped agent permissions, issuer trusts, Radar detections, new events, and more endpoint methods.

  • Role assignments can be added and removed in one request.
  • Organizations can manage which issuers they trust.
  • Radar callers can look up a detection and its evidence.
  • Agent blueprint permissions now specify which agent types can use each permission.
  • Directory Sync group and user methods now use resource-first names.
  • Webhook subscriptions can include SAML certificate replacement events.
  • Token exchange events can be read as typed SDK models.
  • Callers can retrieve a webhook endpoint by its ID.
  • User Management callers can delete an application CORS origin.
  • Generated models and shared type exports reflect updated API schemas.

workos-sdk-automation[bot] explicitly identifies the Directory Sync method removals as intentional breaking changes in the PR description.

Reviews (2) · Last reviewed commit: "chore(generated): add release notes frag..." · Reviewed by Greptile

name: str,
description: str | None = None,
permissions: list[str] | None = None,
permissions: list[AgentBlueprintsCreateRequestPermission | str] | None = None,

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.

P1 Scoped permission calls fail

create_blueprint and update_blueprint now accept permission models, but put those objects directly into the request body. Passing permissions=[AgentBlueprintsCreateRequestPermission(slug="email:send", instance_types=["delegated"])] raises TypeError before sending a request. Both sync and async clients are affected.

Convert each model entry with to_dict() while preserving strings. Update the request models too: their from_dict() and to_dict() methods also pass permission entries through unchanged.

Knowledge Base Used: Product automation services

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/workos/agents/_resource.py
Line: 98

Comment:
**Scoped permission calls fail**

`create_blueprint` and `update_blueprint` now accept permission models, but put those objects directly into the request body. Passing `permissions=[AgentBlueprintsCreateRequestPermission(slug="email:send", instance_types=["delegated"])]` raises `TypeError` before sending a request. Both sync and async clients are affected.

Convert each model entry with `to_dict()` while preserving strings. Update the request models too: their `from_dict()` and `to_dict()` methods also pass permission entries through unchanged.

**Knowledge Base Used:** [Product automation services](https://app.greptile.com/-/switch-tenant?tenant=workos&next=%2Fcustom-context%2Fknowledge-base%2Fworkos%2Fworkos-python%2F-%2Fdocs%2Fproduct-automation-services.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

if (_v_list := data["list"]) is not None
else None,
also_matched_list_ids=data.get("also_matched_list_ids"),
also_matched_lists=data.get("also_matched_lists"),

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.

P1 Matched lists lack model fields

from_dict() leaves also_matched_lists entries as dictionaries despite declaring them as RadarDetectionList objects. For domain-protection results from get_detection(), reading an entry's .name or .workos_managed raises AttributeError.

The reverse direction also fails: to_dict() leaves caller-created model objects in its output. Convert each non-null entry in both directions and preserve null entries.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/workos/common/models/radar_detection_domain_protections_details.py
Line: 38

Comment:
**Matched lists lack model fields**

`from_dict()` leaves `also_matched_lists` entries as dictionaries despite declaring them as `RadarDetectionList` objects. For domain-protection results from `get_detection()`, reading an entry's `.name` or `.workos_managed` raises `AttributeError`.

The reverse direction also fails: `to_dict()` leaves caller-created model objects in its output. Convert each non-null entry in both directions and preserve null entries.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

name: str,
description: str | None = None,
permissions: list[str] | None = None,
permissions: list[AgentBlueprintsCreateRequestPermission | str] | None = None,

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.

P1 Typed permissions cannot be sent

Passing an AgentBlueprintsCreateRequestPermission in permissions raises TypeError before the request is sent. create_blueprint puts the objects straight into the body, but the JSON encoder cannot convert them. The same problem affects update_blueprint, both async methods, and both request models.

Convert permission objects with to_dict() while keeping string entries unchanged. Both request models also need to build typed permission objects in from_dict().

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/workos/agents/_resource.py
Line: 98

Comment:
**Typed permissions cannot be sent**

Passing an `AgentBlueprintsCreateRequestPermission` in `permissions` raises `TypeError` before the request is sent. `create_blueprint` puts the objects straight into the body, but the JSON encoder cannot convert them. The same problem affects `update_blueprint`, both async methods, and both request models.

Convert permission objects with `to_dict()` while keeping string entries unchanged. Both request models also need to build typed permission objects in `from_dict()`.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

if (_v_list := data["list"]) is not None
else None,
also_matched_list_ids=data.get("also_matched_list_ids"),
also_matched_lists=data.get("also_matched_lists"),

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.

P1 Matched lists have wrong types

also_matched_lists promises RadarDetectionList objects, but from_dict() leaves its entries as dictionaries. When another list matched, reading get_detection(...).evidence.details.also_matched_lists[0].name raises AttributeError. In the other direction, to_dict() leaves typed entries as model objects rather than dictionaries.

Convert each non-null entry in both directions, preserving null entries for deleted lists. Add a test that checks the entry type; dictionary round trips hide this bug.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/workos/common/models/radar_detection_domain_protections_details.py
Line: 38

Comment:
**Matched lists have wrong types**

`also_matched_lists` promises `RadarDetectionList` objects, but `from_dict()` leaves its entries as dictionaries. When another list matched, reading `get_detection(...).evidence.details.also_matched_lists[0].name` raises `AttributeError`. In the other direction, `to_dict()` leaves typed entries as model objects rather than dictionaries.

Convert each non-null entry in both directions, preserving null entries for deleted lists. Add a test that checks the entry type; dictionary round trips hide this bug.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autogenerated Autogenerated code or content

Development

Successfully merging this pull request may close these issues.

0 participants