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.
git clone --depth 1 https://github.com/PLUG-OpenAPI/nhplug-sdkWrote 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.
[](https://agentmods.dev/rules/plug-openapi/nhplug-sdk/nhplug)<a href="https://agentmods.dev/rules/plug-openapi/nhplug-sdk/nhplug"><img src="https://agentmods.dev/badge/rules/plug-openapi/nhplug-sdk/nhplug/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.
<a href="https://agentmods.dev/rules/plug-openapi/nhplug-sdk/nhplug"><img src="https://agentmods.dev/badge/rules/plug-openapi/nhplug-sdk/nhplug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01736 | $0.01736 |
| Opus 5.5 | $0.00694 | $0.00694 |
| Sonnet 5.5 | $0.00347 | $0.00347 |
| Haiku 4.5 | $0.00174 | $0.00174 |
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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 118 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 봉투, 인증 헤더, 연속조회, 유량 제어를 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 ≠ 업무 성공
- 🔴 SDK 는 업무 성공/실패를 판정하지 않는다. 기준은 HTTP 상태코드 하나다.
HTTP 200 → 응답 본문 그대로 반환(예외 없음) / 200 아님 →
NhplugError(본문은.raw에 원문). - 🔴
rsp_msg문장을 읽고 판단한다. 같은rsp_cd값이 API 에 따라 정상일 수도 오류일 수도 있어 어떤 코드 목록도 기준이 될 수 없다.status_of(data)로(rsp_cd, rsp_msg)를 꺼낸다(판정 아님). - ⚠️
if rsp_cd == "00000"같은 코드를 절대 쓰지 말 것. 코드값 비교는 API 를 바꾸면 무너진다. - 🔴 주문 등 되돌릴 수 없는 처리 전에는 직전 응답의
rsp_msg를 반드시 확인한다. SDK 가 막아 주지 않는다. - ⚠️
is_success()·NHPLUG_SUCCESS_CODES·category="business"는 0.4.0 에서 삭제됐다. 되살리지 말 것. 원본이 필요하면call(..., raise_on_error=False). 429(초당 5회 초과)는 자동 재시도하지 않는다. 429 재시도에 토큰을 재발급하지 말 것(재발급은 401 에만).
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.
- 1mo ago Changed · +7 lines · +184 tokens per session ce52f3b43954
- 1mo ago Changed · +3 lines · +111 tokens per session 85b1cd78e828
- 1mo ago Changed · +4 lines · +113 tokens per session f48d4d6ceefa
- 1mo ago 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 (14 stars, last pushed 19d ago), licensed MIT. It adds 1,736 tokens to every session, about $0.0069 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-31.
Other cursor rules, from other repositories
invest-skill
Investment analysis rules and frameworks for InvestSkill project.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
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.
prefer-assertions-over-defensive-checks
Prefer assertions over defensive checks when data is guaranteed to be valid.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.