Skip to main content
Axiqual LogoAxiqual
Developer Reference

Axiqual Prompt Quality Engine Documentation

Axiqual runs a rule engine in your browser to check AI prompt quality. You get a clear quality score for each prompt instead of guessing if it is good enough.

The engine runs in your browser. No prompt data leaves your machine. This makes it safe for private workflows in healthcare, finance, and legal AI apps.

This guide covers scoring rules, diagnostic checks, API integration, and common fixes.

How It Works

The Quality Engine checks prompt text across six areas. Each area has pass/fail rules that look at specific prompt traits. The engine returns scores for each area and an overall rating.

The evaluation pipeline follows three stages:

1
Lexical Analysis

The engine reads the prompt and looks for key parts: role definitions, instruction blocks, and output format clues.

2
Rule Evaluation

Each dimension runs its set of deterministic rules. For example, the Security dimension checks for prompt injection patterns and jailbreak attempts.

3
Score Aggregation

Dimension scores are weighted and combined into an overall score. A detailed report with pass/fail findings is generated for review.

Quick Start

You can start checking prompts immediately without signup or API keys. Here are a few example prompts to try:

> You are a helpful assistant. Answer concisely.
> Translate the following to French: Hello world
> System: You are an expert coder. User: Write a function

Steps to run your first analysis:

  1. Navigate to the Prompt Checker page.
  2. Paste your prompt template into the input area.
  3. Click Analyze to run the Quality Engine.
  4. Review the six-dimension score breakdown and individual pass/fail findings.
  5. Use the fix checklist to address flagged issues.

Scoring Rubric

Each area scores from 0 to 100 based on how many rules pass. The overall score uses weighted averages:

Overall Score = 0.20 × Prompt Structure +
                0.15 × Memory & State +
                0.20 × Context Grounding +
                0.25 × Trust & Accuracy +
                0.10 × PII & Privacy +
                0.10 × Security & Safety

Score interpretation:

  • 90-100 — Excellent: Production-ready prompt
  • 70-89 — Good: Minor improvements recommended
  • 50-69 — Fair: Structural or safety issues need attention
  • 0-49 — Poor: Significant risks detected

Prompt Structure

Evaluates whether the prompt follows engineering best practices for formatting, role definition, task clarity, and constraints.

Role definition: Checks if the prompt assigns a clear persona or system role (e.g., "You are an expert...").
Task clarity: Verifies the presence of imperative verbs (translate, summarize, write, analyze).
Boundary separation: Checks for delimiters like backticks, XML tags, or markdown separators.
Output format: Ensures expected output structure is specified (JSON, table, list).

Memory & State

Verifies that the prompt properly manages conversation context, history, and session state.

Context retention: Checks if instructions reference prior context or conversation history.
State directives: Verifies explicit state management instructions (reset, continue, ignore previous).

Context Grounding

Assesses how well the prompt grounds the model with reference materials, data sources, and domain context.

Document references: Checks for cited sources or embedded reference content.
Parameter grounding: Verifies variable placeholders are used instead of hardcoded values.

Trust & Accuracy

Flags hallucination risks, factual accuracy issues, and consistency problems in the prompt design.

Conflicting instructions: Detects contradictory directives within the prompt.
Confidence calibration: Checks for speculative language and uncertainty markers.

PII & Privacy

Detects personally identifiable information exposure risks and data leakage vectors in prompts.

Email detection: Flags email addresses embedded in prompts.
Credential patterns: Detects API keys, passwords, and token patterns.
Data isolation: Checks if private data is isolated from shared context.

Security & Safety

Scans for prompt injection, jailbreak attempts, system instruction leaks, and output boundary violations.

Injection patterns: Detects "ignore previous instructions" and role-escalation attacks.
Jailbreak attempts: Flags known jailbreak prefixes and DAN-style patterns.
Instruction lock: Verifies system instructions are properly bounded and protected.

REST API Reference

The Axiqual REST API allows you to programmatically analyze prompts. Authentication is via bearer token.

POST https://api.axiqual.com/v1/check Headers: Authorization: Bearer <your_api_key> Content-Type: application/json Body: { "prompt": "Your prompt text here", "dimensions": ["structure", "security", "privacy"] }

Generate API keys in your .

CLI Tool

Use the Axiqual CLI to check prompts directly from your terminal. Install via npm:

npm install -g @axiqual/cli aq check --prompt "Your prompt text" aq check --file ./prompts/example.txt aq check --ci --json

The --ci flag exits with a non-zero code on failing prompts, suitable for CI/CD pipelines.

GitHub Actions

Add prompt quality checks to your pull request workflow. Create .github/workflows/prompt-check.yml:

name: Prompt Quality Check on: [pull_request] jobs: check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: npx @axiqual/cli check --glob "prompts/**/*.md"

SDK Reference

Integrate the Quality Engine directly into your Node.js or TypeScript application:

import { analyzePrompt } from '@axiqual/engine'; const result = await analyzePrompt({ text: "Your prompt here", dimensions: ['structure', 'security'] }); console.log(result.score); // 87 console.log(result.findings); // [{ rule, passed, message }]

Troubleshooting

Score shows 0 for all dimensions

Ensure your prompt contains at least 10 characters. Very short prompts may not trigger any rules. Try adding a clear role definition and task description.

The AI Auditor shows "API key required"

The AI Auditor requires an LLM provider API key (OpenAI, Anthropic, etc.) configured in Settings. The Prompt Checker works without any keys.

Lighthouse reports CLS shift on the checker page

The React component hydrates after page load. Reserve a fixed height container around the workspace to prevent layout shift during hydration.

My prompts contain sensitive data

All processing happens locally in your browser. No data is sent to external servers. For the AI Auditor, prompts are sent to the LLM provider you configure.

Frequently Asked Questions

Is the Quality Engine open source?
The browser-side Quality Engine is available as a proprietary SDK. A subset of the rule definitions is published in our documentation for transparency.
Can I add custom rules?
Custom rule definitions are available in the Team plan. You can define dimension weights, add custom pass/fail criteria, and set organization-specific thresholds.
How fast is the analysis?
The deterministic engine completes analysis in under 10 milliseconds for typical prompts. Performance scales linearly with prompt length.