Gregius Data – Prompts

Overview

Gregius Data’s Prompt subsystem manages two types of prompts from a single central registry: system prompts that shape how the AI generates answers, and security prompts that classify queries before they reach your content. A deterministic fallback chain resolves the right prompt at runtime, dynamic token expansion keeps dates current, and an optional security gatekeeper inspects queries before retrieval begins.

Prerequisites

  • WordPress 6.9+ with Gregius Data plugin installed and activated
  • At least one AI model registered and active on the site

Understanding Prompts

Prompts are stored as dedicated records organized by type. Each prompt type serves a distinct purpose:

TypePurposeDefault
SystemInstructions for the AI model during answer generationSystem Default (pre-seeded, active)
SecurityInstructions for classifying user queries as safe or unsafeSecurity Default (pre-seeded, active)

When the system needs a prompt, it resolves the effective content through a deterministic fallback chain within the requested type:

  • Explicit prompt – A specific prompt you choose by ID
  • Selected prompt – The prompt you marked as active for that type
  • Factory prompt – The system-provided default for that type

At runtime, the system expands {{date}}, {{time}}, and {{datetime}} tokens in resolved prompt content using WordPress locale-aware date functions.


How to: Manage System Prompts

System prompts define how the AI model behaves when generating answers. The content, tone, and constraints you set here shape every answer response.

View system prompts

You can browse all system prompts from the Prompt management area. Each entry displays:

  • Title – A label identifying the prompt
  • Type – “System” badge
  • Status – Published or draft
  • Selected – Whether this prompt is currently active
  • Version – Incremented on each update

Create or edit a system prompt

When creating or editing a system prompt, you provide:

  • Title – A descriptive name
  • Content – The full system instruction text
  • Status – Published to make it available, draft to save work in progress
  • Notes – Optional internal notes

Prompts can include {{date}}, {{time}}, and {{datetime}} tokens that expand at resolution time.

Activate a system prompt

Activating a system prompt marks it as the selected (active) prompt for system type. Only one system prompt can be active at a time — activating a new system prompt deselects the previous one. Security prompt selections are unaffected.

Tips

  • Use {{date}} and {{time}} tokens instead of hard-coded dates so prompts stay current without edits
  • The factory default “System Default” is always available as fallback
  • System and security prompts are independent – changing one does not affect the other

How to: Manage Security Prompts

Security prompts define how the AI model classifies user queries before they reach your content. The security prompt instructs the model to determine whether a query is safe or unsafe based on your policy criteria.

View security prompts

Security prompts are listed alongside system prompts with a “Security” type badge. Each entry shows:

  • Title – A label identifying the prompt
  • Type – “Security” badge
  • Status – Published or draft
  • Selected – Whether this prompt is currently active
  • Version – Incremented on each update

Create or edit a security prompt

The process is identical to system prompts: provide a title, content, status, and optional notes. The content should clearly describe what constitutes a safe or unsafe query according to your policies.

Activate a security prompt

Activating a security prompt marks it as the selected prompt for security type. Only one security prompt can be active at a time — activating a new security prompt deselects the previous one. System prompt selections are unaffected.

Tips

  • Keep your security prompt current as your policy requirements evolve
  • The factory default “Security Default” is always available as fallback
  • Activating a security prompt never affects which system prompt is active

How to: Use the Security Gatekeeper

The security gatekeeper is an optional pre-retrieval LLM-based check that classifies user queries before they reach your content or generate answers. It uses your active security prompt to determine whether a query should proceed.

How classification works

When a user submits a query, the gatekeeper:

  • Resolves the active security prompt
  • Sends the query to the AI model with security prompt instructions
  • Classifies the result as SAFE (proceed) or UNSAFE (block)

What happens when a query is blocked

When a query is classified as UNSAFE:

  • The system returns a standard policy response: “I can’t help with that request”
  • No content retrieval or answer generation occurs
  • The event is logged for audit

Audit trail

Every security check is recorded in the interaction log with:

  • Status – SAFE or UNSAFE
  • Reason – Explanation from the AI model
  • Prompt used – Which security prompt was active
  • Usage – Token consumption for the classification call

Tips

  • If classification seems too strict or too lenient, update your security prompt content
  • The gatekeeper runs before any data retrieval — blocked queries never touch your content
  • Review the audit trail regularly to tune your security prompt for accuracy

Permissions

AreaRouteWho can use it
Prompt managementView, create, edit, delete promptsAdministrators only
Prompt activationActivate prompts by typeAdministrators only
Security gatekeeperPre-retrieval query classificationAutomatic (no user action needed)

Next Steps

View on GitHub: You can review, fork, and inspect the entire codebase and core logic over at the repository on GitHub.

Gregius Data is the open-source AI orchestration layer for WordPress.