Skip to content

Approve agent connections once per agent app (#13) - #15

Merged
lseongjoo merged 10 commits into
integration/issue-13from
claude/project-thread-cvhl30
Nov 25, 2026
Merged

lseongjoo merged 10 commits into
integration/issue-13from
claude/project-thread-cvhl30

Conversation

@lseongjoo

@lseongjoo lseongjoo commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Requested by 이성주 · project thread

Refs #13 · 대상 브랜치 integration/issue-13 (main 아님)

요청

에이전트 앱 단위로 연결하고, 한 번 승인받은 앱은 다시 승인받지 않아도 되게 한다.

기준 변경 (2026-11-25)

처음에는 이전 기능(받은 대본 DB 저장, 세로 대본 목록 등)이 빠진 Codex 후보 9f058b4 위에 올렸습니다. 그래서 검토판에서 그 기능들이 회귀했습니다. 복구 PR #23(13개 커밋과 Codex 리뷰 수정 c21eb08)이 integration/issue-13(bced973)에 병합된 뒤, 이 PR을 그 위로 다시 올렸습니다(force-with-lease, 6b8b93e → 15da9e9). 이전 헤드는 6b8b93e에 남아 있습니다.

구성 (9개 커밋)

  1. 05e167b Codex: 앱별 연결·승인·받기·철회·재시도 상태를 분리. 승인 기록 agent-clients.json(0600), 앱별 받기 일시 중지·승인 철회 UI, stdio MCP fixture. 원래 커밋은 0600eb9이고, 전체 기능이 들어 있는 줄기 위에서 작성된 판입니다.
  2. Claude Code 후속 커밋:
    • f46e566: 영구 승인에 필요하던 opt-in Info.plist 키와 미사용 만료를 없앴습니다.
    • 72984f5, 8661758, a9d561e, 18aac11: [AGENT-CONN] 연결·승인·철회 로그(category agent)와 수집 문서를 넣었습니다.
    • 51d4a75: 호스트 서명 검증을 메인 스레드 밖에서 하고 프로세스별로 캐시합니다. 366MB 바이너리에서 750ms 데드라인을 넘기던 문제를 고쳤습니다.
    • 99adc38: 도우미 연결 키를 키체인 대신 개인 파일(0600)에 둡니다. 키체인 키가 cdhash에 묶여 재빌드 뒤 접근할 수 없던 문제를 고쳤습니다.
    • 15da9e9: 신뢰 저장소 테스트를 "승인은 유휴 시간으로 만료되지 않음"(1년 뒤에도 trusted)으로 바꿨습니다.

"에이전트 앱" 식별자

도우미를 직접 실행한 부모 프로세스의 코드 서명으로 앱을 구분합니다. 형식은 registered-v1:<team.TEAMID | 리프 인증서 해시>:<코드 서명 식별자>이고, 앱 이름·경로·PID는 쓰지 않습니다. 예: registered-v1:team.Q6L2SF6YDW:com.anthropic.claude-code.

영구 승인 조건은 다음과 같습니다. 유효한 인증서 서명(애드혹 제외), 강화 런타임, macOS 플랫폼 코드가 아님, get-task-allow·allow-dyld-environment-variables 없음, 번들이면 번들 ID와 서명 식별자가 같음. 이 조건을 못 채우는 호스트는 실행할 때마다 승인합니다.

승인은 만료되지 않습니다. 승인 철회, 서명이나 앱 변경, 키 교체로만 끝납니다.

알려진 한계: 같은 서명된 런타임(예: 공용 node)이 직접 실행하는 서로 다른 도구는 같은 앱으로 보입니다. 연결 키는 사용자 전용 파일이라 추출할 수 없는 키는 아닙니다.

운영 로그

macOS 27.2.1 (26B131), CommandLineTools Swift 6.4.2, Xcode 없음. 기본 SDK(27.2)는 SwiftUIMacros 문제로 main도 실패하므로 SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX26.5.sdk를 지정합니다.

HEAD 명령/절차 결과
15da9e9 전용 워크트리에서 ./build.sh build (애드혹 서명, 실제 서명 키 미사용) exit 0
15da9e9 ./build.sh test exit 0, "All tests passed." Trust store, agent trust store, Agent catalog, Draft history(failed park keeps editor, manual draft reopens 포함), Python MCP 23개, Conversation 134, Explanation style 49
15da9e9 Tests/Fixtures/run_agent_app_connections.py (일회용 자체 서명 인증서와 rcodesign) exit 0, 10/10 PASS (같은 이름의 두 앱 독립 승인, 앱별 철회, 애드혹 호스트 실행별 승인, 수신기 재시작 후 유지 등)
f5bd58b (재구성 전) 실제 Claude Code 2.1.332: 승인 1회 → Claude Code 재시작 → TTS 재시작 scope=persistent result=ok, 이후 lookup=trusted (클릭 없음)

fixture 수는 이전 기록에 11/11로 적었지만, 스크립트의 check는 10개입니다. 10/10이 전체입니다.

남은 확인 항목

  • 재구성된 15da9e9 검토판에서 실제 Claude Code 재연결(재승인 없음)과, 세로 대본 목록·DB 복원이 함께 동작하는지
  • 서로 다른 실제 앱 두 개(예: Claude Code와 Codex)를 동시에 승인하고 한쪽만 철회
  • 사소한 점: AgentCatalogTests.swift:450 요약 출력 문구에 "expiry"가 남아 있음(테스트 동작은 "만료 없음")
  • 되돌리기: Claude Code 커밋들을 revert하면 Codex 후보 동작으로 돌아감

참여 에이전트

  • Codex: 앱별 연결 격리 후보 구현 (모델: 미확인)
  • Claude Code: 앱 식별·만료 정책, 로그, 수동 검증에서 찾은 결함 두 개 수정, 기준 재구성 (모델: Claude Opus 5.5)

🤖 Generated with Claude Code

https://claude.ai/code/session_015LJG7MWqYoCZivtQ96kBhP

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T17:39:56.928447Z 15da9e9 Manual request
🔒 Security Review ✅ Completed 2026-11-25T17:45:44.363130Z 15da9e9 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

lseongjoo and others added 9 commits November 25, 2026 17:31
Bind remembered approval to a registered direct host and its protected key. Require explicit live-session approval when the host cannot be verified. Keep revocation, receipt and draft retry state scoped to each approved client.

Agent: Codex
…13)

Identify the agent app that launches the helper by its code signature:
team ID (or leaf certificate without a team) plus signing identifier.
Any hardened, certificate-signed, non-platform app now gets a durable
approval; the CodebasicTTSDirectMCPHost Info.plist key that no real
agent app carries is no longer required. Hosts may have entitlements
other than get-task-allow and dyld environment variables. Ad-hoc,
unsigned, shell or system-interpreter launchers still get a one-run
approval.

An approval no longer lapses after 30 idle days; it ends only on
revocation, a different signer or app, or a replaced helper key.

Add AgentTrustStoreTests to ./build.sh test.

Agent: Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015LJG7MWqYoCZivtQ96kBhP
Add the [AGENT-CONN] category so the persistent per-app approval can be
verified from the unified log: which app identity reconnected, whether
it was recognized, and what it got. No draft text or key material.

Agent: Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015LJG7MWqYoCZivtQ96kBhP
Agent: Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015LJG7MWqYoCZivtQ96kBhP
Agent: Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015LJG7MWqYoCZivtQ96kBhP
Manual testing with Claude Code (a 366 MB signed binary) showed no
approval request: validating the host signature takes about a second on
the main thread, past the 750 ms pairing deadline, so hello answered
unavailable. Compute the host identity on the socket thread before the
main-thread hop and cache it per running parent process (pid, start
time, executable path), so later checks, including the per-request
delivery verifier, are cheap. Drop the redundant second validity check;
process identity is re-checked instead. Log main-deadline timeouts.

Agent: Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015LJG7MWqYoCZivtQ96kBhP
)

Manual testing found that a Keychain key created by a self-signed helper
(no Team ID) is bound to that build's cdhash. After any rebuild or
update the new helper gets errSecAuthFailed (-25293) on signing, and
since an inaccessible key is never replaced, the approved app could not
connect again. Store the key per identified app in
~/Library/Application Support/Codebasic TTS/agent-client-keys (0700 dir,
0600 file, no symlinks, single link, created atomically). Approval stays
bound to the launching app's code signature. --forget-key deletes the
file. Fixtures keep using their own key directory.

Agent: Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015LJG7MWqYoCZivtQ96kBhP
Agent: Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015LJG7MWqYoCZivtQ96kBhP
Agent: Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015LJG7MWqYoCZivtQ96kBhP
@lseongjoo
lseongjoo force-pushed the claude/project-thread-cvhl30 branch from 6b8b93e to 15da9e9 Compare November 25, 2026 17:31

Copy link
Copy Markdown
Contributor Author

복구 PR #23이 병합된 integration/issue-13(bced973) 위로 이 브랜치를 다시 올렸습니다. 내 PR 브랜치이므로 force-with-lease로 6b8b93e에서 15da9e9로 바꿨습니다. 재검증 결과(build·test exit 0, fixture 10/10)는 본문과 #13에 있습니다.

독립 검토를 요청합니다. 특히 Sources/App/AgentPeerSigning.swift의 영구 승인 조건과 Helpers/AgentCatalogMCP.swift의 파일 키 저장을 봐 주세요.

@codex review


Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 15da9e9f17

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Helpers/AgentCatalogMCP.swift Resolved
…lusive rename (#13)

Turning receipt back on (master switch or per-client resume) clears the
client's rate state again, as the docs say and the earlier code did.
The helper key file is published with renamex_np(RENAME_EXCL) instead
of link()+unlink(), so a helper killed mid-creation can no longer leave
a key with st_nlink == 2 that the reader rejects forever.

Addresses Codex review on PR #15 (discussion_r4698613638,
discussion_r4698613629).

Agent: Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015LJG7MWqYoCZivtQ96kBhP
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 15da9e9f17

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Copy link
Copy Markdown
Contributor Author

증거 기반 병합 (AGENTS.md "합의 대신 증거로 진행")

독립 검토를 요청한 지(17:36Z) 6시간이 지났습니다. 아래 근거로 integration/issue-13에 병합합니다. main에는 병합하지 않습니다.

  • 빌드·테스트 (b4475eb, 현재 헤드): build exit 0, test exit 0 ("All tests passed."), run_agent_app_connections.py 10/10 PASS. 운영 로그는 에이전트 앱별 독립 연결과 승인 관리 #13 댓글 7169931083에 있습니다.
  • Codex 코드 리뷰 (15da9e9): P2 2건이 나왔고 b4475eb에서 고쳤습니다. 두 스레드 모두 해결했고, 남은 지적은 없습니다.
  • Codex 보안 리뷰 (15da9e9): 보안 문제 없음.
  • 이의: 없음. mergeable_state clean.
  • 실측 (재구성 전 f5bd58b): 실제 Claude Code를 한 번 승인한 뒤 Claude Code와 TTS를 각각 재시작해도 lookup=trusted였습니다. 승인 클릭은 다시 필요 없었습니다.

미검증: 재구성한 헤드로 만든 검토판에서 실제 Claude Code가 재승인 없이 다시 연결되는지, 그리고 이전 기능(세로 목록, DB 복원)이 화면에 함께 보이는지는 아직 사용자가 확인하지 않았습니다. 서로 다른 실제 앱 두 개를 동시에 승인하는 경우도 확인하지 않았습니다. integration/issue-13에서 main으로 올리기 전에 확인해야 합니다.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants