diff --git a/examples/basic/pom.xml b/examples/basic/pom.xml index cc1252d..321c610 100644 --- a/examples/basic/pom.xml +++ b/examples/basic/pom.xml @@ -24,7 +24,7 @@ com.getaxonflow axonflow-sdk - 6.1.0 + 8.5.1 diff --git a/examples/basic/src/main/java/com/getaxonflow/examples/Basic.java b/examples/basic/src/main/java/com/getaxonflow/examples/Basic.java index f8f5c67..fb59b84 100644 --- a/examples/basic/src/main/java/com/getaxonflow/examples/Basic.java +++ b/examples/basic/src/main/java/com/getaxonflow/examples/Basic.java @@ -107,8 +107,20 @@ private static void proxyLLMCallStep(AxonFlow client, String clientId) { System.out.printf(" Success: %s%n", response.isSuccess()); System.out.printf(" Blocked: %s%n", response.isBlocked()); } catch (PolicyViolationException e) { - // Policy block is a valid outcome — community policies can match - // the demo query depending on configuration. + // SDK <= 8.5.1 misclassifies 403 auth rejections as policy + // violations: every agent error body carries a literal + // "blocked":false key, which trips handleErrorResponse's + // body.contains("blocked") heuristic. Until the library fix + // ships, treat tenant mismatch as the auth failure it is — + // otherwise a wrong AXONFLOW_CLIENT_ID (it must match the + // user token's tenant) sails through the smoke with exit 0. + if (e.getMessage() != null && e.getMessage().contains("Tenant mismatch")) { + System.err.println("proxyLLMCall failed (auth): " + e.getMessage() + + " — AXONFLOW_CLIENT_ID must match the user token's tenant"); + System.exit(1); + } + // Genuine policy block is a valid outcome — community policies + // can match the demo query depending on configuration. System.out.printf(" Blocked by policy: %s%n", e.getMessage()); } catch (AuthenticationException | ConnectionException e) { // These are real failures: bad creds or stack down. Fail loud. diff --git a/examples/explain-decision/pom.xml b/examples/explain-decision/pom.xml index 5f68122..c8453e8 100644 --- a/examples/explain-decision/pom.xml +++ b/examples/explain-decision/pom.xml @@ -25,7 +25,7 @@ com.getaxonflow axonflow-sdk - 8.5.0 + 8.5.1 diff --git a/examples/list-decisions/pom.xml b/examples/list-decisions/pom.xml index fd1aab1..5b1c46b 100644 --- a/examples/list-decisions/pom.xml +++ b/examples/list-decisions/pom.xml @@ -24,7 +24,7 @@ com.getaxonflow axonflow-sdk - 8.5.0 + 8.5.1 diff --git a/examples/wcp-retry-idempotency/pom.xml b/examples/wcp-retry-idempotency/pom.xml index 11f313f..0197587 100644 --- a/examples/wcp-retry-idempotency/pom.xml +++ b/examples/wcp-retry-idempotency/pom.xml @@ -22,7 +22,7 @@ com.getaxonflow axonflow-sdk - 8.5.0 + 8.5.1