Skip to content

[New Plugin] NeuralTrust TrustGuard - #1772

Open
albertbausili wants to merge 1 commit into
Portkey-AI:mainfrom
albertbausili:feat/neuraltrust-guardrail
Open

[New Plugin] NeuralTrust TrustGuard#1772
albertbausili wants to merge 1 commit into
Portkey-AI:mainfrom
albertbausili:feat/neuraltrust-guardrail

Conversation

@albertbausili

@albertbausili albertbausili commented Aug 18, 2026

Copy link
Copy Markdown

Summary

  • Adds the neuraltrust.evaluate guardrail (issue [Feature] NeuralTrust TrustGuard #1771) so Portkey can send chat, completion, and Anthropic Messages traffic to TrustGuard POST /v1/evaluate.
  • Maps TrustGuard allow / block / report / transform onto Portkey verdicts. Transform writes back messages, completion prompt, or Anthropic system + tool_use. Block with hook deny: true is HTTP 446.
  • Fails closed by default (verdict: false, error: null) so an unreachable TrustGuard cannot be forgiven. unreachableFallback: fail_open restores house style for connect / timeout / 502 / 504 only.
  • Registers the handler in plugins/index.ts and lists neuraltrust in plugins_enabled. Credentials stay on the check (apiKey, optional collectorKey / apiBase).

Description:

  • New partner plugin: plugins/neuraltrust/ (manifest, handler, payload codec, tests, README)
  • Additive registration in plugins/index.ts
  • neuraltrust added to conf.json / conf.example.json plugins_enabled

Tests Run/Test cases added:

  • npx jest plugins/neuraltrust — 60 mocked tests (payload, transforms, fail-closed matrix, HTTP errors) plus optional live suite if .creds.json is present
  • npx prettier --check on the plugin files

Type of Change:

  • New feature (non-breaking change which adds functionality)

Test plan

  • npx jest plugins/neuraltrust (60/60, including the optional live TrustGuard call)
  • Before-request deny: true + TrustGuard block returns HTTP 446 and does not call the provider
  • allow / report still reach the model; transform redacts chat messages and completion prompt
  • Anthropic system and tool_use are preserved on extract/apply (unit coverage; not a live Anthropic provider run)
  • Missing apiKey and unreachable TrustGuard fail closed unless unreachableFallback is fail_open

Register neuraltrust.evaluate so Portkey can send chat, completion, and Anthropic Messages traffic to TrustGuard with fail-closed defaults.
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