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.
npx agentmods add rules/plug-openapi/nhplug-sdk/nhpluggit clone --depth 1 https://github.com/PLUG-OpenAPI/nhplug-sdkWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01328 | $0.01328 |
| Opus 5 | $0.00664 | $0.00664 |
| Sonnet 5 | $0.00266 | $0.00266 |
| Haiku 4.5 | $0.00133 | $0.00133 |
Grade A, and why
nhplug 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 yesterday.
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.
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.
NH투자증권 Open API 개발 규칙
SDK 를 쓴다 — 직접 HTTP 를 짜지 않는다
pip install nhplug # 인증·토큰캐시·에러판정·실시간·종목마스터 포함
pip install "nhplug[instruments]" # 마스터를 DataFrame 으로 받을 때
from nhplug import call, NhplugError
call("/krstock/quote/v1/currentPrice", {"iem_cd": "005930", "market_cd": "KRX"})
토큰 발급·갱신·캐시, Input_0 봉투, 인증 헤더, rsp_cd 판정을 call() 이 처리한다.
requests 로 /oauth2/token 을 직접 부르는 코드를 새로 만들지 말 것.
명세 정본 — 도메인
- https://www.nhplug.com/llms.txt (N2: https://www.n2plug.com/llms.txt)
- 자산군:
https://www.nhplug.com/openapi-docs/<자산>/openapi.json(common·krstock·gbstock·krfuture·gbfuture·krbond·krgold) - 경로·필드명·필수여부는
openapi.json이 정본. 추측 금지.
설정 (.env)
NHPLUG_APP_KEY=...
NHPLUG_APP_SECRET=...
NHPLUG_BASE_URL=https://api.nhplug.com:8443 # 모의투자: moapi.nhplug.com:8443
NHPLUG_AUTH_URL=https://api.nhplug.com:8443 # 토큰은 운영 전용
NHPLUG_INSTRUMENTS_BASE=https://www.nhplug.com/instruments
키는 코드에 하드코딩 금지. .env 는 .gitignore.
N2 고객은 위 세 줄을 모두 n2plug 로 — 하나라도 빠지면 그 기능만 조용히 나무로 간다.
호출 규약
- 요청
{"Input_0": {...}}/ 응답Output_0(+Output_1) +rsp_cd·rsp_msg Output_0은 객체일 수도 배열일 수도 있다. 타입을 추측하지 말고openapi.json확인.- 계좌목록
POST /n2/acctinfo→Output_0[].acct_no를 이후act_no로 사용.
⚠️ 성공 판정 — HTTP 200 ≠ 업무 성공
- 성공 코드:
00000·00166·00221·13578(+rsp_msg에 "완료" 포함) 00000/00166만 성공으로 보지 말 것 — 매수가능수량 조회는00221로 응답한다.429(초당 5회 초과)는 자동 재시도하지 않는다. 429 재시도에 토큰을 재발급하지 말 것(재발급은 401 에만).
⚠️ 계좌구분(acct_type)
01·02 = 운영(api) · 03 = 모의투자(moapi).
계좌목록에 섞여 내려오므로 첫 계좌를 그대로 쓰지 말고 환경에 맞는 구분을 고른다.
종목마스터
from nhplug.instruments import load_master
df = load_master("m_new_stock") # 자동 다운로드·캐시
전 종목 목록은 REST API 가 없고 마스터 파일 28종으로 제공된다. 다운로드는 인증 불필요.
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.
- yesterday First seen · 104 lines · 1,328 tokens per session scan A 7ec197ac9ab1
nhplug is a cursor rule published in the GitHub repository PLUG-OpenAPI/nhplug-sdk (8 stars, last pushed 4d ago), licensed MIT. It adds 1,328 tokens to every session, about $0.0066 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.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.
specs
This directory contains product and tech specs for Streamlit features.