Skip to content

feat(policies): add allowedProviders field for dynamic policies#39

Merged
saurabhjain1592 merged 9 commits into
mainfrom
feat/allowed-providers-field
Jan 5, 2026
Merged

feat(policies): add allowedProviders field for dynamic policies#39
saurabhjain1592 merged 9 commits into
mainfrom
feat/allowed-providers-field

Conversation

@saurabhjain1592

Copy link
Copy Markdown
Member

Summary

Add allowedProviders field to dynamic policy types for GDPR, HIPAA, and RBI compliance. This enables restricting LLM routing to specific providers when a dynamic policy matches.

Changes

  • Add allowedProviders field to DynamicPolicy class (getter + setter)
  • Add allowedProviders field to CreateDynamicPolicyRequest with Builder.allowedProviders() method
  • Add allowedProviders field to UpdateDynamicPolicyRequest with Builder.allowedProviders() method
  • Update CHANGELOG for v2.1.0

Example Usage

// Create a GDPR-compliant policy that only routes to EU providers
CreateDynamicPolicyRequest request = CreateDynamicPolicyRequest.builder()
    .name("GDPR Compliance - EU Data Only")
    .description("Restricts financial data to EU-based LLM providers")
    .type("compliance")
    .allowedProviders(List.of("azure-eu-west", "anthropic-eu"))
    .priority(100)
    .enabled(true)
    .build();

DynamicPolicy policy = client.createDynamicPolicy(request);

Related

  • Issue #883 (axonflow-enterprise) - Strict provider enforcement for dynamic policies
  • Part of SDK parity update across Go, Python, TypeScript, Java SDKs

Add allowedProviders field to dynamic policy types for GDPR, HIPAA, and RBI
compliance. This enables restricting LLM routing to specific providers when
a dynamic policy matches.

- Add allowedProviders to DynamicPolicy, CreateDynamicPolicyRequest,
  UpdateDynamicPolicyRequest
- Add Builder.allowedProviders() methods with Javadoc
- Update CHANGELOG for v2.1.0
- Removed allowedProviders from DynamicPolicy, CreateDynamicPolicyRequest, UpdateDynamicPolicyRequest
- Added category field to DynamicPolicy and request types
- Added Javadoc documentation showing correct usage via action config
- Backend stores allowed_providers in action.config, not as top-level field
Agent proxy (Issue #886) returns wrapped responses:
- List endpoints return {"policies": [...]}
- Single policy endpoints return {"policy": {...}}

Added wrapper types:
- DynamicPoliciesResponse
- DynamicPolicyResponse

Fixed methods:
- listDynamicPolicies
- getDynamicPolicy
- createDynamicPolicy
- updateDynamicPolicy
- toggleDynamicPolicy
- getEffectiveDynamicPolicies
- Add addTenantIdHeader() call to buildOrchestratorRequest() method
- Ensures tenant identification works in community/self-hosted mode
- Fixes 'Missing tenant ID' error for dynamic policy API calls
Agent proxy (Issue #886) returns wrapped responses:
- List endpoints: {"policies": [...]}
- Single item endpoints: {"policy": {...}}

Updated test stubs to return wrapped responses.
- Added SENSITIVE_DATA for policies returning 'sensitive-data' category
- Fixes getEffectiveStaticPolicies validation errors
The server's dynamic policy update endpoint uses PUT, not PATCH.
This fixes HTTP 405 errors when toggling policy enabled state.
docs: add toggleDynamicPolicy HTTP method fix to changelog
@saurabhjain1592 saurabhjain1592 merged commit 6e41897 into main Jan 5, 2026
9 checks passed
saurabhjain1592 added a commit that referenced this pull request Jan 6, 2026
* feat(policies): add allowedProviders field for dynamic policies

Add allowedProviders field to dynamic policy types for GDPR, HIPAA, and RBI
compliance. This enables restricting LLM routing to specific providers when
a dynamic policy matches.

- Add allowedProviders to DynamicPolicy, CreateDynamicPolicyRequest,
  UpdateDynamicPolicyRequest
- Add Builder.allowedProviders() methods with Javadoc
- Update CHANGELOG for v2.1.0

* fix: use action.config for allowed_providers instead of top-level field

- Removed allowedProviders from DynamicPolicy, CreateDynamicPolicyRequest, UpdateDynamicPolicyRequest
- Added category field to DynamicPolicy and request types
- Added Javadoc documentation showing correct usage via action config
- Backend stores allowed_providers in action.config, not as top-level field

* fix: correct dynamic policy response parsing for wrapped API responses

Agent proxy (Issue #886) returns wrapped responses:
- List endpoints return {"policies": [...]}
- Single policy endpoints return {"policy": {...}}

Added wrapper types:
- DynamicPoliciesResponse
- DynamicPolicyResponse

Fixed methods:
- listDynamicPolicies
- getDynamicPolicy
- createDynamicPolicy
- updateDynamicPolicy
- toggleDynamicPolicy
- getEffectiveDynamicPolicies

* fix: add X-Tenant-ID header to orchestrator requests

- Add addTenantIdHeader() call to buildOrchestratorRequest() method
- Ensures tenant identification works in community/self-hosted mode
- Fixes 'Missing tenant ID' error for dynamic policy API calls

* test: update dynamic policy tests for wrapped API responses

Agent proxy (Issue #886) returns wrapped responses:
- List endpoints: {"policies": [...]}
- Single item endpoints: {"policy": {...}}

Updated test stubs to return wrapped responses.

* chore: bump version to 2.1.0

* fix: add sensitive-data category to PolicyCategory enum

- Added SENSITIVE_DATA for policies returning 'sensitive-data' category
- Fixes getEffectiveStaticPolicies validation errors

* fix: use PUT instead of PATCH for toggleDynamicPolicy

The server's dynamic policy update endpoint uses PUT, not PATCH.
This fixes HTTP 405 errors when toggling policy enabled state.

* fix: update toggleDynamicPolicy test to use PUT instead of PATCH

docs: add toggleDynamicPolicy HTTP method fix to changelog
@saurabhjain1592 saurabhjain1592 deleted the feat/allowed-providers-field branch January 11, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant