Skip to content

[Feature] NeuralTrust TrustGuard #1771

Description

@albertbausili

Plugin Name

NeuralTrust TrustGuard

Description

Add NeuralTrust TrustGuard as a bidirectional guardrail plugin for the Portkey Gateway.

TrustGuard evaluates LLM input and output via POST /v1/evaluate and returns allow, block, report, or transform (redact). The plugin maps those verdicts onto Portkey's hook engine: block fails the check (HTTP 446 when deny: true), report records findings without blocking, and transform rewrites chat messages, completion prompt, or Anthropic Messages (including top-level system and tool_use).

What it adds

  • Check id neuraltrust.evaluate on beforeRequestHook and afterRequestHook
  • Credentials on the check (apiKey, optional collectorKey / apiBase), not in gateway conf.json
  • Fail-closed by default when TrustGuard is unreachable, with an opt-in unreachableFallback: fail_open
  • Unit tests that mock the shared utils.post helper

Implementation is ready (manifest, handler, tests). A PR will reference this issue.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions