HN 표시: Kontext – Go의 AI 코딩 에이전트를 위한 자격 증명 브로커

hackernews | | 📦 오픈소스
#ai 코딩 #claude #cli #go #에이전트 #자격 증명
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

Kontext CLI는 개발자의 기존 작업 방식을 변경하지 않으면서 AI 코딩 에이전트에 기업 수준의 보안 및 거버넌스를 제공하는 오픈소스 명령줄 도구입니다. 기존의 .env 파일에 수명이 긴 API 키를 저장하는 위험한 방식 대신, 이 도구는 세션 시작 시 단명(SST) 토큰을 주입하고 종료 시 자동으로 만료시키는 안전한 자격 증명 관리를 지원합니다. 사용자는 `.env.kontext` 파일을 통해 필요한 권한을 선언하기만 하면 되며, 시스템은 RFC 8693 토큰 교환과 OIDC 인증을 통해 자동으로 권한을 부여합니다. 또한 에이전트의 모든 도구 호출 이벤트를 백엔드로 스트리밍하여 철저한 감사 추적 및 거버넌스 모니터링을 제공하지만, 대화 내용이나 LLM 추론 과정은 기록하지 않아 개인정보를 보호합니다. 현재 Claude Code를 완벽하게 지원하며, 별도의 데몬이나 복잡한 설정 없이 Go 기반의 가벼운 바이너리로 간편하게 실행할 수 있습니다.

본문

Kontext CLI is an open-source command-line tool that wraps AI coding agents with enterprise-grade identity, credential management, and governance — without changing how developers work. Why we built it: AI coding agents need access to GitHub, Stripe, databases, and dozens of other services. Today, teams copy-paste long-lived API keys into .env files and hope for the best. Kontext replaces that with short-lived, scoped credentials that are injected at session start and gone when the session ends. Every tool call is logged. Every secret is accounted for. How it works: You declare what credentials your project needs in a single .env.kontext file. When you run kontext start , the CLI authenticates you, exchanges placeholders for short-lived tokens via RFC 8693 token exchange, launches your agent with those credentials injected, and streams every tool call to the Kontext dashboard for audit and governance. When the session ends, credentials expire automatically. brew install kontext-dev/tap/kontext If you prefer a direct binary install, download the latest GitHub Release instead: tmpdir="$(mktemp -d)" \ && gh release download --repo kontext-dev/kontext-cli --pattern 'kontext_*_darwin_arm64.tar.gz' --dir "$tmpdir" \ && archive="$(find "$tmpdir" -maxdepth 1 -name 'kontext_*_darwin_arm64.tar.gz' -print -quit)" \ && tar -xzf "$archive" -C "$tmpdir" \ && sudo install -m 0755 "$tmpdir/kontext" /usr/local/bin/kontext Then, from any project directory with Claude Code installed: kontext start --agent claude That's it. On first run, the CLI handles everything interactively — login, provider connections, credential resolution. Run kontext logout any time to clear the stored OIDC session from your system keyring. kontext start --agent claude - Authenticates — opens browser for OIDC login, stores refresh token in system keyring, and lets you clear it later with kontext logout - Creates a session — registers with the Kontext backend, visible in the dashboard - Resolves credentials — reads .env.kontext , exchanges placeholders for short-lived tokens - Launches the agent — spawns Claude Code with credentials injected as env vars + governance hooks - Captures hook events — PreToolUse, PostToolUse, and UserPromptSubmit events streamed to the backend - Tears down cleanly — session ended, credentials expired, temp files removed - One command to launch Claude Code: kontext start --agent claude — no config files, no Docker, no setup scripts - Ephemeral credentials: short-lived tokens scoped to the session, automatically expired on exit. No more long-lived API keys in .env files - Declarative credential templates: commit .env.kontext to your repo, and every developer on the team gets the same credential setup without sharing secrets - Governance telemetry: Claude hook events are streamed to the backend with user, session, and org attribution - Secure by default: OIDC authentication, system keyring storage, RFC 8693 token exchange, AES-256-GCM encryption at rest - Lean runtime: native Go binary, no local daemon install, no Node/Python runtime required - Update notifications: on kontext start , a background check queries the public GitHub releases API (cached for 24h, never blocks startup). Disable withKONTEXT_NO_UPDATE_CHECK=1 The .env.kontext file declares what credentials the project needs: GITHUB_TOKEN={{kontext:github}} STRIPE_KEY={{kontext:stripe}} DATABASE_URL={{kontext:postgres/prod-readonly}} Commit this to your repo — the whole team shares the same template. Secrets stay in Kontext, never in source control. | Agent | Flag | Status | |---|---|---| | Claude Code | --agent claude | Active | Cursor and Codex support are planned, but they are not shipped in this repo yet. kontext start --agent claude │ ├── Auth: OIDC refresh token from keyring ├── ConnectRPC: CreateSession → session in dashboard ├── Sidecar: Unix socket server (kontext.sock) │ └── Heartbeat loop (30s) ├── Hooks: settings.json → Claude Code --settings ├── Agent: spawn claude with injected env │ │ │ ├── [PreToolUse] → kontext hook → sidecar → backend │ ├── [PostToolUse] → kontext hook → sidecar → backend │ └── [UserPromptSubmit] → kontext hook → sidecar → backend │ └── On exit: EndSession → cleanup Go sidecar: A lightweight sidecar process runs alongside the agent and communicates over a Unix socket. Hook handlers send normalized events through the sidecar so the CLI can keep agent-specific logic out of the backend contract. Governance telemetry: Session lifecycle and hook events flow to the Kontext backend, powering the dashboard with sessions, traces, and audit history. The CLI captures what the agent tried to do and what happened, but never captures LLM reasoning, token usage, or conversation history. # Build go build -o bin/kontext ./cmd/kontext # Generate protobuf (requires buf + plugins) buf generate # Test go test ./... go test -race ./... go vet ./... gofmt -w ./cmd ./internal # Link for local use ln -sf $(pwd)/bin/kontext ~/.local/bin/kontext Service definit

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →