Skip to content

CUSTOM_JWT runtime invocation fails silently for rejected bearer tokens #2745

Closed

Description

@jariy17

Description

When agentcore invoke calls a CUSTOM_JWT Runtime with a rejected bearer token, the command exits unsuccessfully without printing an error. The Runtime response contains an HTTP status and useful JSON error message, but the CLI discards the body and suppresses the resulting error.

Steps to Reproduce

  1. Configure and deploy a Runtime with authorizerType set to CUSTOM_JWT.

  2. Invoke it with an invalid or expired token:

    agentcore invoke --runtime <runtime-name> --bearer-token <invalid-or-expired-token> --payload '{"prompt":"hello"}'\n   echo $?\n   ```\n\n3. Observe stdout, stderr, and the exit status.\n\n## Expected Behavior\n\nThe command exits nonzero and prints an actionable error containing at least the HTTP status. When safe and available, it should also include the service error type or message, for example that the token has expired.\n\n## Actual Behavior\n\nThe command exits with status 1 and prints nothing to stdout or stderr. Debug logging records only the HTTP status.\n\nIn the v1 implementation, `invokeRuntimeWithCustomJwt` cancels the non-success response body and throws `RuntimeInvokeResponseError("HTTP <status>")`. `RuntimeInvokeResponseError` extends `SilentCLIError`, so the top-level runner does not print it.\n\n## CLI Version\n\nObserved with 1.0.1 and confirmed in the current `v1.x` implementation.\n\n## Operating System\n\nLinux\n\n## Additional Context\n\nRelevant public code paths:\n\n- `src/core/invokeRuntime.ts`\n- `src/errors/errors.tsx`\n- `src/runnable/index.tsx`\n\nThe fix should preserve a bounded response size and avoid exposing bearer tokens or request headers in output or logs.

Activity

  1. added
    bug
    port-to-v1
    on Nov 2, 2026
  2. self-assigned this
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugport-to-v1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions