# How to Implement the No Invention Principle in Agent Prompts within aios-core

> Learn how to implement the No Invention principle in agent prompts using aios-core. Ensure all statements trace to requirements via constitutional_gate for robust AI development.

- Repository: [SynkraAI/aios-core](https://github.com/synkraai/aios-core)
- Tags: how-to-guide
- Published: 2026-02-16

---

**The No Invention principle requires that every statement in an agent prompt must be traceable to an explicit requirement (FR-*, NFR-*, CON-*) or verified research finding, enforced through a `constitutional_gate` block in the task definition.**

When building agentic workflows in SynkraAI/aios-core, implementing the No Invention principle ensures that sub-agents never hallucinate or introduce unsanctioned facts. This article explains how to configure agent prompts to satisfy Article IV of the AIOS Constitution through traceable inputs, constitutional gates, and runtime validation.

## What Is the No Invention Principle?

Article IV of the Synkra AIOS Constitution defines the **No Invention** principle as a non-negotiable constraint: every output produced by an agent must derive directly from explicit inputs. Permitted sources include:

- **Functional requirements** (`FR-*`)
- **Non-functional requirements** (`NFR-*`)
- **Constraints** (`CON-*`)
- **Verified research findings** (documented in [`research.json`](https://github.com/SynkraAI/aios-core/blob/main/research.json))

When an agent constructs a prompt for a sub-agent, the same traceability rules apply. The prompt template may only contain information that exists in the workflow's inputs, reference data, or prior step outputs.

## Where the Rule Is Enforced in aios-core

The No Invention principle is enforced at three architectural layers within the aios-core repository.

### Constitutional Definition

The rule originates in [`.aios-core/constitution.md`](https://github.com/SynkraAI/aios-core/blob/main/.aios-core/constitution.md), which enumerates the required traceability sources and defines Article IV in natural language. This document serves as the ground truth for all downstream validation logic.

### Task-Level Gates

Individual tasks declare compliance requirements through a `constitutional_gate` block. For example, [`.aios-core/development/tasks/spec-write-spec.md`](https://github.com/SynkraAI/aios-core/blob/main/.aios-core/development/tasks/spec-write-spec.md) includes a gate named "No Invention" that specifies validation rules and the `BLOCK` severity level. The workflow engine checks this gate before marking the task complete.

### Runtime Validation

The workflow engine ([`.aios-core/development/tasks/run-workflow-engine.md`](https://github.com/SynkraAI/aios-core/blob/main/.aios-core/development/tasks/run-workflow-engine.md)) implements the validation stage that traverses generated prompts, extracts free-form text, and verifies that every claim maps to an allowed source. Violations trigger a `BLOCK` gate, preventing the sub-agent from executing.

## How to Implement No Invention in Agent Prompts

Follow this four-step workflow to ensure your agent prompts comply with Article IV.

### Step 1: Declare Inputs with Traceable IDs

Define all inputs in your task configuration, ensuring each references a file containing tagged requirements or research. Use explicit identifiers like `FR-12` or `CON-7` within these files.

```yaml
inputs:
  - name: requirements
    type: file
    path: docs/stories/{{storyId}}/spec/requirements.json
    required: true
  - name: research
    type: file
    path: docs/stories/{{storyId}}/spec/research.json
    required: false

```

### Step 2: Configure the constitutional_gate Block

Add a `constitutional_gate` block to your task definition that references Article IV and defines the validation criteria.

```yaml
constitutional_gate:
  article: IV
  name: No Invention
  severity: BLOCK
  validation:
    - Every statement MUST reference FR‑*, NFR‑*, CON‑* or a verified research finding
    - No free‑form speculation allowed
  on_violation:
    action: BLOCK
    message: |
      CONSTITUTIONAL VIOLATION: Article IV – No Invention
      The generated content contains statements not traceable to inputs.
      Review the following lines:
      {list_violations}

```

### Step 3: Populate the Sub-agent Prompt Template

Use the template at [`.aios-core/development/templates/subagent-step-prompt.md`](https://github.com/SynkraAI/aios-core/blob/main/.aios-core/development/templates/subagent-step-prompt.md) to construct prompts. Populate placeholders **only** with data from your declared inputs.

```yaml

# The engine will fill the following placeholders:

{{INPUT_DATA}}        → YAML dump of `requirements` and `research`
{{REFERENCE_DATA}}    → Any static reference files (e.g., CON‑* constraints)
{{USER_INPUT}}        → Empty because `elicit: false` for this task

```

The resulting prompt sent to the sub-agent will look like this:

```text
You are {{AGENT_NAME}}, {{AGENT_TITLE}}.

## Your Persona

{{AGENT_YAML}}

## Your Task

{{TASK_CONTENT}}

## Context

Workflow: spec-pipeline | Step: write-spec | Phase: Write

## Input Data

requirements:
  FR-1: "User can log in with Google OAuth"
  FR-2: "Session expires after 30 minutes"
  CON-1: "No external network calls in login flow"
research:
  verified: true
  notes: "google-auth-library v9.x pattern"

## Reference Data

# (empty – all needed data already in INPUT_DATA)

## User Input (Elicitation)

# (none)

## Step Instructions

Generate the spec.md ensuring every sentence references an FR‑*, NFR‑*, CON‑* or a verified research finding.

```

### Step 4: Validate Before Execution

Run your task with the interactive flag to generate a traceability report before full execution.

```bash
aios run-task spec-write-spec --storyId EX-01 --mode=interactive

```

The console output will highlight any invented statements that lack requirement IDs, allowing you to fix the source data before the `BLOCK` gate halts the workflow.

## Code Examples

### Minimal Task with No Invention Enforcement

```yaml

# .aios-core/development/tasks/example-no-invention.md

---
title: Example No Invention Task
agent: architect
uses: subagent-step-prompt.md
elicit: false
deterministic: true

inputs:
  - name: requirements
    type: file
    path: docs/stories/EX-01/spec/requirements.json
    required: true
  - name: research
    type: file
    path: docs/stories/EX-01/spec/research.json
    required: false

outputs:
  - name: result.md
    type: file
    path: docs/stories/EX-01/spec/result.md
    template: result-tmpl.md

constitutional_gate:
  article: IV
  name: No Invention
  severity: BLOCK
  validation:
    - Every statement MUST reference FR‑*, NFR‑*, CON‑* or a verified research finding
    - No free‑form speculation allowed
  on_violation:
    action: BLOCK
    message: |
      CONSTITUTIONAL VIOLATION: Article IV – No Invention
      The generated content contains statements not traceable to inputs.
      Review the following lines:
      {list_violations}

```

### Safely Adding New Requirements

When you need to introduce new facts to a prompt, add them to the source files first:

```json
// docs/stories/EX-01/spec/requirements.json
{
  "FR-10": "Support two-factor authentication via TOTP",
  "NFR-4": "2FA must complete within 2 seconds"
}

```

Then reference these IDs in your task configuration or prompt template. Because `FR-10` and `NFR-4` now exist in an input file, the No Invention validator in [`run-workflow-engine.md`](https://github.com/SynkraAI/aios-core/blob/main/run-workflow-engine.md) will accept statements referencing them.

## Summary

- **The No Invention principle** (Article IV) mandates that every agent output must trace back to explicit requirements (`FR-*`, `NFR-*`, `CON-*`) or verified research.
- **Enforcement happens at three layers**: the Constitution definition ([`.aios-core/constitution.md`](https://github.com/SynkraAI/aios-core/blob/main/.aios-core/constitution.md)), task-level `constitutional_gate` blocks (e.g., in [`spec-write-spec.md`](https://github.com/SynkraAI/aios-core/blob/main/spec-write-spec.md)), and runtime validation in the workflow engine.
- **Prompt construction** relies on the [`subagent-step-prompt.md`](https://github.com/SynkraAI/aios-core/blob/main/subagent-step-prompt.md) template, where placeholders like `{{INPUT_DATA}}` must be populated exclusively from declared input files.
- **Violations trigger a BLOCK gate**, preventing sub-agent execution and returning diagnostic messages indicating which statements lack traceability.

## Frequently Asked Questions

### What happens if an agent invents information not in the inputs?

The workflow engine detects the violation during the validation stage defined in [`run-workflow-engine.md`](https://github.com/SynkraAI/aios-core/blob/main/run-workflow-engine.md). It triggers the `BLOCK` action specified in the `constitutional_gate` block, halting the task and returning a diagnostic message listing the specific lines that contain untraceable statements. The sub-agent never receives the prompt until the source data is corrected.

### Can I include assumptions or "best practices" in agent prompts?

No. Any assumption or best practice must first be documented as a constraint (`CON-*`) or requirement (`FR-*`/`NFR-*`) in the appropriate input file (e.g., [`requirements.json`](https://github.com/SynkraAI/aios-core/blob/main/requirements.json)). Once it has a traceable ID, you can reference it in the prompt. The validator in [`spec-write-spec.md`](https://github.com/SynkraAI/aios-core/blob/main/spec-write-spec.md) rejects free-form speculation regardless of whether it seems correct.

### How do I add new requirements to satisfy the No Invention principle?

Edit the relevant input file (typically `docs/stories/{storyId}/spec/requirements.json` or [`research.json`](https://github.com/SynkraAI/aios-core/blob/main/research.json)) to add the new requirement with a unique ID (e.g., `FR-10`). Ensure the JSON file is committed to the repository. When the task runs, the engine loads this file into `{{INPUT_DATA}}`, making the new requirement available for traceable references in agent prompts.

### Which files define the No Invention validation logic?

The validation logic is distributed across three key files: [`.aios-core/constitution.md`](https://github.com/SynkraAI/aios-core/blob/main/.aios-core/constitution.md) defines Article IV conceptually; [`.aios-core/development/tasks/spec-write-spec.md`](https://github.com/SynkraAI/aios-core/blob/main/.aios-core/development/tasks/spec-write-spec.md) implements the `constitutional_gate` block that configures the validation rules; and [`.aios-core/development/tasks/run-workflow-engine.md`](https://github.com/SynkraAI/aios-core/blob/main/.aios-core/development/tasks/run-workflow-engine.md) contains the runtime engine that traverses prompts, extracts claims, and verifies them against the allowed sources before allowing sub-agent execution.