Skip to content

feature: Allow config_id for nemo check plugin from plugins config #36

@evaline-ju

Description

@evaline-ju

Feature Description

Since the plugins adapter should allow for configuring particular Nemo rails on particular tools, the adapter:
(1) needs to accept configuration to specify Nemo rails
(2) needs to pass Nemo rail information to the Nemo check plugin

The adapter itself does not interface with the Nemo guardrails check server directly and currently there is no additional component e.g. controller that is dynamically fetching individual rail information from the check server via /v1/rails/configs. This information needs to be supplied at configuration time for the adapter, for the adapter to call expected Nemo rail checks on expected tools (or other MCP primitives etc.).

The individual config_id needs to be passed on the same level as messages on /v1/guardrails/check calls

e.g.

curl -ks -X POST $NEMO_GUARDRAILS_ROUTE/v1/guardrail/checks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $(oc whoami -t)" \
  -d '{
        "model": "dummy/model",
        "guardrails": {
          "config_id": "NEMO_CONFIG" # supply this here 
        },
        "messages": [{
          "role": "user",
          "content": "Content to check..."
        }]
      }'

Proposed Solution

Example config - nemo_config_id as a plugin-specific config

 - name: "PromptInjectionPrevention"
   kind: "plugins.examples.nemocheck.plugin.NemoCheck" # Plugin classpath
   hooks: ["tool_pre_invoke"] # Current hook for tool request check
   mode: "enforce"
   priority: 100 # Lower number = higher priority
   conditions:
     - tools: ["test2_hello_world"] 
       server_ids: []
       tenant_ids: []
   config: # Nemo guardrails plugin-specific settings
     checkserver_url: "http://nemo-guardrails-service:8000/v1/guardrail/checks"
     nemo_config_id: "prompt-injection-prevention" # *** This needs to map to a rail ID in Nemo that can be fetched via `/v1/rails/configs`

Want to contribute?

  • I would like to work on this issue.

Additional Context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions