uiprotect: Instructions file for Codex

AGENTS.md

uiprotect AGENTS.md is an instructions file for Codex, OpenCode from uilibs/uiprotect. It costs 6,455 tokens per session, scanned A, original, MIT.

A contributor guide for uiprotect, an unofficial Python client and command-line tool for UniFi Protect security cameras and recorders. It explains the project, its code layout, and its changing server protocol.

In plain words
What is it for?
Orienting contributors, finding important files, understanding the UniFi Protect API and live update stream, and following project-specific development practices.
Why use it?
It gives coding agents the project context needed before changing code. It highlights compatibility concerns caused by firmware changes and the lack of an official protocol owner.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is uilibs/uiprotect's own configuration. It tells Codex and OpenCode how to work on uiprotect itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything uiprotect configures →

Reuse

Borrowing it

Nothing to install: this file belongs to uilibs/uiprotect. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/uilibs/uiprotect/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/uilibs/uiprotect

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/uilibs/uiprotect/agents-md/github.svg)](https://agentmods.dev/instructions/uilibs/uiprotect/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/uilibs/uiprotect/agents-md"><img src="https://agentmods.dev/badge/instructions/uilibs/uiprotect/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for uiprotect AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/uilibs/uiprotect/agents-md"><img src="https://agentmods.dev/badge/instructions/uilibs/uiprotect/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6,455 This file is loaded in full into every session.
When invoked 6,455 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.06455 $0.06455
Opus 5.5 $0.02582 $0.02582
Sonnet 5.5 $0.01291 $0.01291
Haiku 4.5 $0.00645 $0.00645

Measured 20d ago against content hash 1c76904ca6b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

uiprotect 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 20d 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 · 479 lines

How it starts

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

Notes for LLM contributors

A short orientation file for an LLM working in this repo. Skim before making changes; keep edits consistent with what's described here. Read README.md for the user-facing intro and CONTRIBUTING.md for the human-facing contributor guide.

What this project is

uiprotect is an unofficial async Python client + CLI for the UniFi Protect surveillance NVR. It is the library that the Home Assistant unifiprotect integration is built on top of, and it is the de-facto Python binding for talking to a UniFi Protect console — Ubiquiti does not publish an official one. Public API is exported from the top-level uiprotect package; the main entry point is uiprotect.ProtectApiClient in src/uiprotect/api.py.

There is no upstream protocol owner. The wire format is whatever the UniFi Protect server in front of you serves: a partially documented REST API plus a binary WebSocket update stream. Both shift across firmware releases, and the test corpus under tests/sample_data/ is the closest thing to a reference. Behaviour changes that depend on a specific Protect firmware version should say so in the commit message.

The project was forked from pyunifiprotect after that project relicensed away from MIT; staying MIT-licensed is a hard requirement so the Home Assistant core integration can keep depending on it.

Code style

  • Docstrings: terse, default to single-line. A docstring is the function's contract, not its narrative. Almost every docstring should be one line — """Summary.""" — describing what the function does and what the caller can pass. Multi-line is the exception, only justified when there is non-obvious caller-visible behaviour the type signature and parameter names don't already convey. Ruff is configured with most of the D family disabled (D100–D107, D2xx, D4xx) precisely so that missing docstrings on internal helpers don't flag — only add one when it earns its keep.

Read the full file on GitHub · 479 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. 20d ago Changed · +17 lines · +267 tokens per session 1c76904ca6b5
  2. 1mo ago Changed · +2 lines · +21 tokens per session 00cfdc588d71
  3. 1mo ago Changed · -3 tokens per session eaa5c9cabe88
  4. 2mo ago First seen · 460 lines · 6,170 tokens per session scan A 186ec49e3321

Subscribe to this mod's changes

uiprotect AGENTS.md is an instructions file published in the GitHub repository uilibs/uiprotect (105 stars, last pushed yesterday), licensed MIT. It adds 6,455 tokens to every session, about $0.0258 per session on Opus 5.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.

Related

uiprotect AGENTS.md compared with instructions from other repositories

uiprotect AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
uiprotect AGENTS.mduilibs/uiprotectInstructions file105yesterdayMITA6,455Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode