Skip to content

Response JSON Schema

To have consistent, parseable outputs that can be processed by infrastructure APIs, Service Owners can define the expected structure of the AI's response using JSON Schema format.

When a response schema is defined, the LLM is instructed to return its output in a structure that matches the schema. This ensures that downstream automation, scripts, and integrations can reliably parse the AI Processor's output without manual intervention.

JSON Schema Example

A typical response schema for a firewall rule configuration might look like this:

{
  "type": "object",
  "title": "FirewallRuleConfig",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": ["rules", "default_action"],
  "properties": {
    "rules": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["name", "source", "destination", "port", "action"],
        "properties": {
          "name": { "type": "string" },
          "source": { "type": "string" },
          "destination": { "type": "string" },
          "port": { "type": "integer" },
          "action": { "type": "string", "enum": ["allow", "deny"] }
        }
      }
    },
    "default_action": {
      "type": "string",
      "enum": ["allow", "deny"]
    }
  }
}

Schema restrictions by AI Processor type

Not all AI Processor types support custom response schemas:

  • Change Instance Validator — Custom response schema is disabled. NetOrca expects a specific response format defined internally, since the validator must return a structured approval or rejection decision that NetOrca can act on.
  • Pack Optimizer — Custom response schema is not required. The optimizer produces a document of notes and recommendations to help the LLM optimize prompts in subsequent runs, so a strict schema-based output is not needed.
  • Universal Executor — When the Universal Executor is enabled, the AI Processor's response must follow a specific JSON Schema required by the executor. This schema is managed by NetOrca and cannot be overridden by the Service Owner. Any custom response schema defined on the AI Processor will be ignored.

Generative UI Response JSON Schema

When Generative UI is enabled on an AI Processor, the LLM must return a JSON response that NetOrca can render as UI components. The Generative UI schema — which defines the supported component types and styles — is automatically sent to the LLM as a JSON Schema.

This does not conflict with the Service Owner's custom response schema. When both are enabled, NetOrca combines them into a single response structure:

{
  "data": { "... Service Owner's custom response schema output" },
  "gen_ui": { "... Generative UI components" }
}

This means the LLM produces both a JSON output for PackData and a JSON response that can be rendered by the NetOrca UI in the same response.

LLM-defined UI

When no deterministic schema is set on the AI Processor, the Generative UI Catalog Schema (configured in General Settings) is used. The LLM decides which components to return and in what order based on the prompt and the available component types. This gives the model flexibility to choose the most appropriate layout for each response.

Deterministic UI

You can optionally define a fixed UI layout by setting a Response JSON Schema directly on the AI Processor. This overrides the catalog schema and locks the structure — the LLM only fills in the content within the predefined components, but cannot change the component types, order, or count.

This is useful when you need a consistent, predictable UI layout across all responses. For details and a full example, see Generative UI — Deterministic UI.

Summary

Scenario Final response schema sent to LLM
Pack Pipeline — response schema only Service Owner's custom schema
Pack Pipeline — generative UI only Generative UI catalog schema (or deterministic schema)
Pack Pipeline — both response schema and generative UI enabled Combined: {"data": <custom schema>, "gen_ui": <UI schema>}
Pack Pipeline — neither enabled None — LLM responds with free-form text
Universal Executor enabled NetOrca-managed internal schema (custom schema disabled)
Change Instance Validator NetOrca-managed internal schema (custom schema disabled)
Pack Optimizer None — free-form notes (schema not required)

LLM Compatibility

Important: Not all LLM models natively support structured JSON schema response formatting. NetOrca Pack handles this limitation through an automatic fallback mechanism:

  • Models with JSON schema support: The response schema is passed as a structured parameter to the LLM.
  • Models without JSON schema support: The response schema is automatically converted to text instructions and appended to the final prompt.