openportfolio AGENTS.md

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

Repository instructions for OpenPortfolio, a codebase where one deployment can contain multiple separate books or tenants. They define rules for keeping each tenant's data isolated and for avoiding provider API keys.

In plain words
What is it for?
Use them when changing authentication, database tables, indexes, queries, document lookups, or service-key handling in this repository.
Why use it?
They give coding agents and contributors the project rules needed to avoid cross-tenant data leaks and other prohibited changes.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/seonglae/openportfolio/agents-md.svg)](https://agentmods.dev/instructions/seonglae/openportfolio/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/seonglae/openportfolio/agents-md"><img src="https://agentmods.dev/badge/instructions/seonglae/openportfolio/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,997 This file is loaded in full into every session.
When invoked 1,997 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.01997 $0.01997
Opus 5 $0.00999 $0.00999
Sonnet 5 $0.00399 $0.00399
Haiku 4.5 $0.00200 $0.00200

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

Security

Grade A, and why

openportfolio 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 · 143 lines

How it starts

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

Working in this repo

Notes for contributors, and for agent CLIs operating here. What the product is arguing is in README.md; this file is about the code.

Two invariants

Everything else in this file is a convention. These two are not.

1. Tenant isolation

One deployment holds many books, and a caller never says which tenant it is.

  • Every table except tenants carries tenantId, and every index on those tables leads with it. A query that forgets the scope cannot use an index.
  • requireTenant(ctx, args) in convex/auth.ts is the only way a function learns its tenant. It derives one from the caller's membership rows or from the service key's own row.
  • tenantSlug is accepted as a disambiguator for a caller who belongs to several tenants. It is checked against membership before it is believed. There is no tenantId argument anywhere in the public API, and adding one is the bug this section exists to prevent.
  • Anything fetched by document id goes through inTenant(scope, doc), which throws not found for a foreign row. Not forbidden: that would confirm the row exists, which is the cross-tenant read.
  • A service key maps to exactly one tenant, is stored as a SHA-256 hash, and carries its own role.
  • One function crosses tenants: forecasts.resolveDue, the resolver cron. It is an internalMutation and uses the tenant-less by_status_due index. Nothing else may use that index, and no new cross-tenant function should exist without the same treatment.

When adding a table: tenantId: v.id("tenants"), indexes named by_tenant_* with tenantId first, requireTenant at the top of every handler, appendAudit on every write.

2. No provider API key

There is no model API key in this repo, in .env.example, or in any code path, and adding one changes what the project is. Model calls go through actor.mts, which spawns an agent CLI the operator is already signed in to. If a feature seems to need a key, it needs a CLI invocation instead.

Read the full file on GitHub · 143 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 · 143 lines · 1,997 tokens per session scan A af2a35295a55

Subscribe to this mod's changes

openportfolio AGENTS.md is an instructions file published in the GitHub repository seonglae/openportfolio (0 stars, last pushed 5d ago), licensed Apache-2.0. It adds 1,997 tokens to every session, about $0.0100 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-31.

Related

Other instructions, from other repositories

Vibe-Research AGENTS.md

AGENTS.md instructions for simonlin1212/Vibe-Research, covering vibe-research-agent 金融研究宪法, 0. 三条不可越线, 1. 数据纪律(五问 gate:给出任何数字或结论前逐条自问), 2. 研究哲学(评估框架,不是预测工具) and 3. 估值口径(你只选输入、解释输出;计算交给 calc/).

simonlin1212/Vibe-Research · 4,469 tokens

worldmonitor AGENTS.md

AGENTS.md instructions for koala73/worldmonitor, covering agents.md, task mode and authority, start here, surface routing and architecture invariants.

koala73/worldmonitor · 2,568 tokens

qdash CLAUDE.md

Claude Code instructions for oqtopus-team/qdash, covering qdash project reference guide, quick reference, project overview, architecture and directory structure.

oqtopus-team/qdash · 894 tokens

HA-Websocket-Stripper CLAUDE.md

Instructions for GabrielGoldsteinAnidea/HA-Websocket-Stripper, covering ha websocket stripper — project context, what this is / why it exists, why this approach (history — don't re-litigate), mechanism and allowlist computation.

GabrielGoldsteinAnidea/HA-Websocket-Stripper · 2,977 tokens

clawock AGENTS.md

AGENTS.md instructions for KCNyu/clawock, covering agents.md - your workspace, every session, kcn 偏好, git hook (one-time setup per clone) and git auto-commit rules.

KCNyu/clawock · 2,140 tokens

clawock CLAUDE.md

Claude Code instructions for KCNyu/clawock, covering claude.md, identity & user, required reads (every session, in order), what lives where and cron run loop (what openclaw fires).

KCNyu/clawock · 867 tokens