tiygate AGENTS.md

tiygate AGENTS.md is an instructions file for Codex, OpenCode from tiylabs/tiygate. It costs 1,187 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for TiyGate, an open-source Rust AI Gateway organized as a Cargo workspace with eight crates and a web admin console.

In plain words
What is it for?
Use them when working on TiyGate so changes fit the crate boundaries, web console, documentation, scripts, and testing layout.
Why use it?
They give coding agents the project’s structure, engineering rules, build and test commands, and naming conventions.

Instructions file for CodexOpenCode

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 instructions/tiylabs/tiygate/agents-md
Clone the repo
git clone --depth 1 https://github.com/tiylabs/tiygate

Made for: Codex, OpenCode.

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 tiygate AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/tiylabs/tiygate/agents-md.svg)](https://agentmods.dev/instructions/tiylabs/tiygate/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/tiylabs/tiygate/agents-md"><img src="https://agentmods.dev/badge/instructions/tiylabs/tiygate/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,187 This file is loaded in full into every session.
When invoked 1,187 The same file — it is already loaded in full.
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 $0.01187 $0.01187
Opus 5 $0.00593 $0.00593
Sonnet 5 $0.00237 $0.00237
Haiku 4.5 $0.00119 $0.00119

Measured 4d ago against content hash c6814217940f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tiygate AGENTS.md 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 4d 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.

AGENTS.md · 57 lines

How it starts

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

Repository Guidelines

Contributor guide for TiyGate, an open-source Rust AI Gateway. Preserve the crate layering described below; it is intentional and enforced.

Project Structure & Module Organization

This repository is a Cargo workspace with 8 crates and an embedded admin console:

  • crates/core contains canonical IR, traits, and pipeline code. It must stay zero-I/O and free of concrete provider, protocol, or database dependencies.
  • crates/protocols implements protocol codecs for chat completions, messages, responses, Gemini, and embeddings.
  • crates/providers stores built-in provider metadata and auth; crates/provider-bedrock isolates heavy AWS Bedrock SDK dependencies.
  • crates/store, crates/cache, crates/admin, and crates/server cover config storage, embedding cache, Admin REST/OAuth, and the tiygate binary.
  • webui/ is the React + TypeScript + Vite admin console, embedded with rust-embed and served at /admin/ui.
  • docs/ holds architecture and protocol capability docs; scripts/ contains helper checks such as verify-deps.sh.
  • Tests live in crates/<crate>/tests/ for integration tests and inline #[cfg(test)] modules for unit tests.

Engineering Principles

Keep changes aligned with three project constraints:

  • Reliability first: keep the request hot path resilient with fallback budgets, circuit breakers, ingress limits, graceful drain, and telemetry/logging off the hot path.
  • Extensible by design: add providers, protocols, routing strategies, cache backends, and log sinks through existing trait/registration boundaries instead of central rewrites.
  • Maintainable layering: keep core as canonical IR + traits only, use the IR to avoid N×N protocol coupling, document lossy protocol behavior in docs/protocol-capability-matrix.md, and isolate heavy dependencies in dedicated crates.

Build, Test, and Development Commands

Run commands from the repository root. Use make help for the full list.

make build        # Build webui, then release Rust binary
make build-debug  # Build webui, then debug Rust binary
make dev          # Build webui and run tiygate-server with webui feature
make dev-server   # Run Rust server only, without webui embedding
make dev-web      # Start the WebUI Vite dev server
make check        # cargo check --workspace --all-targets --all-features
make test         # cargo test --workspace --all-features
make lint         # rustfmt check, clippy -D warnings, and webui tsc
make fmt          # Format Rust and WebUI code
make audit        # Run cargo audit and npm audit

Read the full file on GitHub · 57 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. 4d ago First seen · 57 lines · 1,187 tokens per session scan A c6814217940f

Subscribe to this mod's changes

tiygate AGENTS.md is an instructions file published in the GitHub repository tiylabs/tiygate (139 stars, last pushed 4d ago), licensed Apache-2.0. It adds 1,187 tokens to every session, about $0.0059 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-08-30.