ax-python-signature

ax-python-signature is a skill for Claude Code, Codex from ax-llm/ax. It costs 35 tokens per session (691 once invoked), scanned A, original, Apache-2.0.

A Python guide for defining clear input and output shapes for axllm programs. It explains signatures, field types, JSON Schema, validation, and typed tool arguments.

In plain words
What is it for?
Use it to declare contracts for programs and tools, generate JSON schemas, validate results, and describe bounded class outputs.
Why use it?
It helps keep prompts, tool inputs, and agent results consistent and makes their expected data structure explicit.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

About the project

Ax is a TypeScript-first programming framework for building applications with large language models through typed generation, agents, workflows, and optimization tools. It is intended for developers who want one model for LLM programs across TypeScript, Python, Java, C++, Go, Rust, and other runtimes.

ax-llm/ax · 2,892 stars · on GitHub · axllm.dev

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ax-llm/ax/ax-python-signature
Any agent
npx skills add ax-llm/ax --skill ax-python-signature
Clone the repo
git clone --depth 1 https://github.com/ax-llm/ax

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ax-python-signature

README.md
[![agentmods](https://agentmods.dev/badge/skills/ax-llm/ax/ax-python-signature.svg)](https://agentmods.dev/skills/ax-llm/ax/ax-python-signature)
Your own site
<a href="https://agentmods.dev/skills/ax-llm/ax/ax-python-signature"><img src="https://agentmods.dev/badge/skills/ax-llm/ax/ax-python-signature.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 691 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00035 $0.00691
Opus 5 $0.00017 $0.00345
Sonnet 5 $0.00007 $0.00138
Haiku 4.5 $0.00003 $0.00069

Measured 2d ago against content hash 445d978c9f91, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

ax-python-signature scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/python/skills/ax-python-signature/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Ax Signatures For Python

This skill helps an agent write Python code with the generated Ax package axllm. Use the generated package API, examples, and manifests; do not import TypeScript-only APIs unless you are editing the TypeScript package.

When To Use

  • Declare input and output contracts with native generated-package APIs.
  • Generate JSON-schema-compatible shapes for outputs, tools, prompts, and validation.
  • Keep Standard Schema and TypeScript-only helper libraries out of generated-language code.

Package Facts

  • Language: Python.
  • Package: axllm.
  • Package API docs: API.md and axir-api.json.
  • Capability manifest: axir-capabilities.json.
  • Runnable examples: examples/.
  • Real network support: yes.
  • Scripted no-key transport support: yes.
  • Runtime profiles: javascript-quickjs, python-pyodide.

Core Pattern

from axllm import s

sig = s("question:string -> answer:string")
schema = sig.to_json_schema("outputs")

More Patterns

Simple string contract

Use the string form when field names and types are enough.

from axllm import ax

program = ax("questionText:string -> answerText:string")

Bounded class output

A class field constrains the model to a known label set.

router = ax(
    'messageText:string -> routeClass:class "support, sales, engineering"'
)

Fluent constraints

Python exposes the native fluent builder for validation constraints and objects.

from axllm import f

signature = (
    f()
    .input("contactEmail", f.string("Contact email").email())
    .output("partySize", f.number("Guests").min(1).max(12))
    .output("bookingCode", f.string().regex(r"^[A-Z]{3}-\d{4}$"))
    .build()
)

JSON schema

Render the output contract for tools, validators, or external consumers.

schema = signature.to_json_schema("outputs")

Reuse the signature

Pass one built signature into AxGen and call it like any other program.

program = ax(signature)
output = program.forward(client, inputs)

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 104 lines · 35 tokens per session scan A 445d978c9f91

Subscribe to this mod's changes

ax-python-signature is a skill published in the GitHub repository ax-llm/ax (2,892 stars, last pushed today), licensed Apache-2.0. It adds 35 tokens to every session and 691 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories