kb-agentcore-identity

kb-agentcore-identity is a skill for Claude Code from minorun365/my-claude-code-settings. It costs 37 tokens per session (2,557 once invoked), scanned B, original, MIT.

A Japanese guide for connecting Amazon Bedrock AgentCore Identity to outside services through OAuth 2.0, a common sign-in and authorization method. It documents how to keep token retrieval separate from the functions that call external tools.

In plain words
What is it for?
Use it when adding OAuth 2.0 access to external APIs, configuring providers and scopes, handling authorization callbacks, or separating token-fetching code from tool functions.
Why use it?
It helps avoid authentication code being interpreted as a tool's input, which can make an agent request access tokens as ordinary parameters. It records a safer structure for obtaining and using access tokens.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: model in frontmatter.

Good fit Use it when adding OAuth 2.0 access to external APIs, configuring providers and scopes, handling authorization callbacks, or separating token-fetching code from tool functions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/minorun365/my-claude-code-settings/kb-agentcore-identity
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.

Any agent
npx skills add minorun365/my-claude-code-settings --skill kb-agentcore-identity
Clone the repo
git clone --depth 1 https://github.com/minorun365/my-claude-code-settings

Made for: Claude Code.

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 kb-agentcore-identity

README.md
[![agentmods](https://agentmods.dev/badge/skills/minorun365/my-claude-code-settings/kb-agentcore-identity/github.svg)](https://agentmods.dev/skills/minorun365/my-claude-code-settings/kb-agentcore-identity)
Your own site
<a href="https://agentmods.dev/skills/minorun365/my-claude-code-settings/kb-agentcore-identity"><img src="https://agentmods.dev/badge/skills/minorun365/my-claude-code-settings/kb-agentcore-identity/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 kb-agentcore-identity

Your own site · 80×15
<a href="https://agentmods.dev/skills/minorun365/my-claude-code-settings/kb-agentcore-identity"><img src="https://agentmods.dev/badge/skills/minorun365/my-claude-code-settings/kb-agentcore-identity.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,557 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 4 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 5
    Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.
    Fix: Remove the model/provider override or disclose it prominently and require explicit operator approval before invoking an external coding CLI or billed model.
  • medium Data Exfiltration · line 39
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 71
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 71
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
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.00037 $0.02557
Opus 5 $0.00018 $0.01278
Sonnet 5 $0.00007 $0.00511
Haiku 4.5 $0.00004 $0.00256

Measured 10d ago against content hash 7863dbe07e7d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

kb-agentcore-identity scanned grade B with 2 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 10d 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.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

resp = requests.post( "https://www.googleapis.com/calendar/v3/calendars/primary/events",

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

resp = requests.post(
claude/skills/kb-agentcore-identity/SKILL.md · 219 lines

How it starts

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

AgentCore Identity(アウトバウンド認証)

先に AWS Agent Toolkit を当たる。 この領域は aws-agents:agents-connect(アウトバウンド認証を担当) がカバーする。 このスキルは Toolkit の代わりではなく、公式どおりにやったのに動かなかったときの原因を貯めておく場所として使う。 Toolkit 側が同じ内容をカバーしたと分かった項目は、このスキルから削る(両方に置くと、更新されるのは公式側だけなのでこちらが古い情報の発生源になる)。

Bedrock AgentCore Identity を使った外部サービスとの OAuth2 連携パターンを記録する。

@requires_access_token@tool は必ず分離する

@tool@requires_access_token を同じ関数にスタックすると、パラメータ解析が干渉してツールが正しく動作しない(エージェントが access_token を入力パラメータとして要求してしまう)。

# ❌ NG: デコレータをスタック → パラメータ干渉
@tool
@requires_access_token(provider_name="my-provider", scopes=[...], auth_flow="USER_FEDERATION")
async def get_pages(*, access_token: str):
    ...

# ✅ OK: トークン取得とツールを分離
@requires_access_token(provider_name="my-provider", scopes=[...], auth_flow="USER_FEDERATION",
    on_auth_url=lambda url: print(f"認可URL: {url}"),
    callback_url="http://localhost:9090/oauth2/callback")
def get_token(access_token: str = ""):
    return access_token

@tool
def get_pages():
    """外部APIのページ一覧を取得する"""
    token = get_token()
    response = httpx.get("https://api.example.com/pages",
        headers={"Authorization": f"Bearer {token}"})
    return response.json()

内部関数パターン(推奨:よりコンパクト)

トークン取得関数をツール内部に定義するとファイルを分けずに済む。公式サンプル(01_outbound.py)もこの方式:

@tool
def add_calendar_event(
    summary: str,
    start_datetime: str,
    end_datetime: str,
    description: str = "",
):
    """Google Calendarに予定を追加する。"""

    @requires_access_token(
        provider_name=PROVIDER_NAME,
        scopes=["https://www.googleapis.com/auth/calendar"],
        auth_flow="USER_FEDERATION",
        on_auth_url=lambda url: print(f"認証URL: {url}"),
        callback_url="http://localhost:9090/oauth2/callback",
    )
    def call_api(access_token: str = ""):
        event = {
            "summary": summary,
            "start": {"dateTime": start_datetime, "timeZone": "Asia/Tokyo"},
            "end": {"dateTime": end_datetime, "timeZone": "Asia/Tokyo"},
        }
        resp = requests.post(
            "https://www.googleapis.com/calendar/v3/calendars/primary/events",
            headers={"Authorization": f"Bearer {access_token}"},
            json=event,
        )
        return resp.json()

    result = call_api()
    if "error" in result:
        return f"失敗: {result['error']['message']}"
    return f"登録完了: {result.get('summary')}"

Read the full file on GitHub · 219 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. 10d ago First seen · 219 lines · 37 tokens per session scan B 7863dbe07e7d

Subscribe to this mod's changes

kb-agentcore-identity is a skill published in the GitHub repository minorun365/my-claude-code-settings (129 stars, last pushed 11d ago), licensed MIT. It adds 37 tokens to every session and 2,557 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 2 findings (sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens