Building Conditions with an LLM
The context you give the LLM
A prompt template
You are helping me author a TACo condition in JSON.
Reference material (please read before writing any condition):
- Schema (JSON Schema, machine-readable source of truth):
https://raw.githubusercontent.com/nucypher/taco-web/signing-epic/packages/taco/schema-docs/condition-schema.json
- Schema (prose version, same source):
https://github.com/nucypher/taco-web/blob/signing-epic/packages/taco/schema-docs/condition-schemas.md
- Cookbook of examples: https://docs.taco.build/for-developers/taco-sdk/references/conditions/cookbook
- Annotated complex example: https://docs.taco.build/for-developers/taco-sdk/references/conditions/discord-tipping-bot-deep-dive
Rules:
- Output a single JSON object (no prose around it) when I ask for a condition.
- Every field must exist in the schema. Do not invent fields.
- Context variables start with ":" and match /^:[a-zA-Z_][a-zA-Z0-9_]*$/.
- CompoundCondition: max 5 operands.
- MultiConditions (CompoundCondition, IfThenElseCondition, SequentialCondition)
share a combined nesting depth limit of 4.
- SequentialCondition: 2–20 variables.
- After each condition you produce, I will run validate-conditions.ts and
paste the output back. Fix any validation errors and try again.
What I want the condition to enforce:
<describe your access policy in plain English>The iteration loop
Tips that materially improve LLM output
JSON Schema integration
Editors
LLM structured output
Standalone validation (any language)
Last updated