[New Plugin] NeuralTrust TrustGuard - #1772
Open
albertbausili wants to merge 1 commit into
Open
Conversation
Register neuraltrust.evaluate so Portkey can send chat, completion, and Anthropic Messages traffic to TrustGuard with fail-closed defaults.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
neuraltrust.evaluateguardrail (issue [Feature] NeuralTrust TrustGuard #1771) so Portkey can send chat, completion, and Anthropic Messages traffic to TrustGuardPOST /v1/evaluate.allow/block/report/transformonto Portkey verdicts. Transform writes backmessages, completionprompt, or Anthropicsystem+tool_use. Block with hookdeny: trueis HTTP 446.verdict: false,error: null) so an unreachable TrustGuard cannot be forgiven.unreachableFallback: fail_openrestores house style for connect / timeout / 502 / 504 only.plugins/index.tsand listsneuraltrustinplugins_enabled. Credentials stay on the check (apiKey, optionalcollectorKey/apiBase).Description:
plugins/neuraltrust/(manifest, handler, payload codec, tests, README)plugins/index.tsneuraltrustadded toconf.json/conf.example.jsonplugins_enabledTests Run/Test cases added:
npx jest plugins/neuraltrust— 60 mocked tests (payload, transforms, fail-closed matrix, HTTP errors) plus optional live suite if.creds.jsonis presentnpx prettier --checkon the plugin filesType of Change:
Test plan
npx jest plugins/neuraltrust(60/60, including the optional live TrustGuard call)deny: true+ TrustGuardblockreturns HTTP 446 and does not call the providerallow/reportstill reach the model;transformredacts chatmessagesand completionpromptsystemandtool_useare preserved on extract/apply (unit coverage; not a live Anthropic provider run)apiKeyand unreachable TrustGuard fail closed unlessunreachableFallbackisfail_open