Developer resources

Naturalization Quality Layer

Natural prose without a single moved fact: protected spans locked first, every change traced to a versioned rule.

Overview

  • The Naturalization Quality Layer rewrites machine-sounding prose into natural editorial English without altering a single fact.
  • Every factual element is located and locked before any analysis runs, so names, numbers, quotes, citations and hedges survive the rewrite byte for byte.
  • Detection is deterministic and versioned: each finding names the rule and the rule pack version that produced it, so a result can always be reproduced.
  • Nothing is applied silently. A change is automatic only when its disposition is inside the profile's auto-fix levels; everything else is returned as a suggestion.

The LUCID quality standard

  1. Lineage

    Every change is traceable to a rule id, a rule pack version and a character span in the source.

  2. Understanding

    Each finding carries an explanation a human editor can accept or reject on its merits.

  3. Coherence

    Rhythm, transitions and paragraph shape are assessed across the whole document, not sentence by sentence.

  4. Integrity

    Protected spans and certainty markers are locked: facts and the strength of a claim never move.

  5. Delivery

    Output is delivered with a quality report: findings, dispositions, applied changes and fidelity checks.

Naturalization pipeline

The naturalization pipeline runs ten stages, four deterministic and free.

  1. 1. Ingest

    Accept the source artifact and normalize it to plain text with stable character offsets.

  2. 2. Extract protected spans

    Lock the 22 protected classes plus certainty markers. Deterministic and free.

  3. 3. Detect patterns

    Run the published rule pack over the text and raise a finding per match with a span.

  4. 4. Explain findings

    Attach a severity, a disposition and a human-readable reason to every finding.

  5. 5. Plan changes

    Select the findings the profile's change budget and auto-fix levels permit.

  6. 6. Bounded rewrite

    Rewrite only the planned spans. Protected spans are passed through untouched.

  7. 7. Validate fidelity

    Re-extract protected spans and confirm every locked value is still present and unchanged.

  8. 8. Quality report

    Emit the LUCID report: lineage per change, scores, applied and suggested findings.

Protected spans

22 classes plus certainty markers, locked before analysis.

  • PERSON
  • ORGANIZATION
  • PRODUCT
  • PLACE
  • DATE
  • TIME
  • MONEY
  • PERCENT
  • INTEGER
  • DECIMAL
  • MEASUREMENT
  • URL
  • EMAIL
  • DOI
  • ISBN
  • CITATION
  • DIRECT_QUOTE
  • CODE
  • LEGAL_REFERENCE
  • CUSTOM_TERM
  • TRADEMARK
  • HEADLINE_IF_LOCKED
  • Extraction runs before detection, so no rule can ever propose a change inside a locked span.
  • A finding that overlaps a locked span is marked protected_overlap and is never applied automatically, whatever its disposition.
  • Certainty markers such as may, might, could, estimated, approximately, around, up to, as much as, reported, suggests, appears, likely, unlikely, according to, based on, preliminary are locked too: deleting a hedge silently strengthens a claim.
  • CUSTOM_TERM locks your own vocabulary, and HEADLINE_IF_LOCKED protects an approved headline from being reworded.
json
{
  "protected_spans": [
    { "class": "MONEY", "text": "$5.2 million", "start": 142, "end": 154, "locked": true },
    { "class": "DIRECT_QUOTE", "text": "We see a fundamental shift", "start": 301, "end": 327, "locked": true },
    { "class": "CERTAINTY_MARKER", "text": "may reduce", "start": 89, "end": 99, "locked": true }
  ]
}

Naturalization profiles

  • change_budget (0-5) caps how much of the document may be rewritten: 0 makes no changes, 3 is standard editorial cleanup, 5 allows maximum restructuring.
  • auto_fix_levels lists the dispositions applied without review. Only AUTO_SAFE and AUTO_BOUNDED are eligible.
  • target_genre tunes the rules: technical and legal genres keep terminology and structure, marketing allows more rhythm changes.
  • voice_profile_id binds a brand voice from your voice profiles to the bounded rewrite stage.
  • custom_banned_terms are never emitted in refined output, and protected_classes chooses which of the 22 classes are locked.

Disposition system

AUTO_SAFE

Mechanical, meaning-preserving edits: deleting an empty intensifier, collapsing a redundant pair. Applied automatically when enabled.

AUTO_BOUNDED

Rewrites limited to one span with a fixed strategy, such as replacing a generic transition. Applied automatically when enabled.

SUGGEST_ONLY

Judgement calls: sentence rhythm, list-to-prose, unwarranted certainty. Returned as suggestions and never applied.

HUMAN_REQUIRED

Findings touching protected spans or legal and medical claims. A human decision is mandatory.

API reference

bash
curl -X POST https://lucidry.io/functions/createNaturalizationJob \
  -H "Authorization: Bearer $LUCIDRY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "source_artifact_id": "art_01H8XKM2",
    "profile_id": "prof_01H8XKM9"
  }'

# 201 Created
# {
#   "job_id": "nat_01H8XKN4",
#   "status": "pending",
#   "protected_span_summary": { "total": 12, "by_class": { "MONEY": 2, "DATE": 3 } }
# }

Get a naturalization profile

bash
curl -X POST https://lucidry.io/functions/getNaturalizationProfile \
  -H "Authorization: Bearer $LUCIDRY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "profile_id": "prof_01H8XKM9" }'

# 200 OK: change_budget, auto_fix_levels, protected_classes, target_genre.
# Provider API keys are never part of any response.

Configure a provider key

bash
curl -X POST https://lucidry.io/functions/configureLLMProvider \
  -H "Authorization: Bearer $LUCIDRY_SESSION" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "anthropic",
    "api_key": "sk-ant-...",
    "load_balancing_strategy": "balanced"
  }'

# 200 OK
# { "provider": "anthropic", "connected": true, "message": "success" }
#
# The key is encrypted with AES-256-GCM at rest, is never returned by any
# endpoint, and can only be set by an organization admin.

MCP tools

naturalize_content

Runs the full pipeline on an artifact with a naturalization profile and returns the refined text plus the quality report.

analyze_text

Runs extraction and detection only. Returns protected spans and findings with no rewriting and no LLM cost.

Pricing

  • Naturalization is priced per word, from $0.015 to $0.030 depending on change budget and genre.
  • Deterministic stages, meaning ingest, protected span extraction, pattern detection and fidelity validation, cost zero.
  • Only the bounded rewrite stage consumes provider tokens, so a suggestion-only pass never incurs LLM spend.
  • When you configure your own provider keys, provider spend is billed to your account and tracked per job in your dashboard.