Skip to content
Back to skills

Llm Structured Outputs

ASecurity

Get reliable structured data from LLMs with JSON schemas, provider structured-output modes, validation and repair

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentsrustshellsqlapi

Works with

  • api

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add ansh44233/forge --skill llm-structured-outputs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Llm Structured Outputs?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Llm Structured Outputs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ansh44233-llm-structured-outputs/badge)](https://www.skillsdirectory.com/skills/ansh44233-llm-structured-outputs)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Get reliable structured data from LLMs with JSON schemas, provider structured-output modes, validation and repair
profile: standard
tags: ai, llm, json, validation
---

# LLM structured outputs

Never parse free text with regex when the provider can return schema-valid JSON.

## Generation
- Use the provider's structured-output or tool-calling mode with a JSON Schema (or zod/pydantic-derived schema).
- Keep schemas small and flat; describe each field; use enums for closed sets.

## Validation
- Validate every response against the schema in code; treat it as untrusted input.
- On failure, retry once with the validation error, then fail loudly; log failures for evals.

## Safety
- Never execute, render as HTML or use in SQL/shell any model output without validation and escaping.

## Verify
A test feeds known inputs (with a mocked or recorded model response, plus one malformed response) and asserts parsed objects or a clean failure.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.