# API Design Feedback Request:  swift-nio-ssh  PR #220 (SSH Agent Hooks / External Signers)

**URL:** <https://forums.swift.org/t/api-design-feedback-request-swift-nio-ssh-pr-220-ssh-agent-hooks-external-signers/88129>\
**Category:** SwiftNIO\
**Tags:** swift-nio-ssh\
**Created:** [July 8, 2026, 1:49am UTC](https://forums.swift.org/t/api-design-feedback-request-swift-nio-ssh-pr-220-ssh-agent-hooks-external-signers/88129 "2026-07-08T01:49:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![camunro](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/camunro/32/46754_2.png) [@camunro](https://forums.swift.org/u/camunro)\
**Post date:** [July 8, 2026, 1:49am UTC](https://forums.swift.org/t/api-design-feedback-request-swift-nio-ssh-pr-220-ssh-agent-hooks-external-signers/88129/1 "2026-07-08T01:49:30Z")

</div>

Hi everyone,

I have had an open PR on `swift-nio-ssh` (PR #220 [feat: support for external signers in NIOSSHPrivateKey by camunro · Pull Request #220 · apple/swift-nio-ssh · GitHub](https://github.com/apple/swift-nio-ssh/pull/220)) for a while to add hook support for SSH agents and external signers. I've recently rebased the changes, and I would love to get some high-level architectural feedback from the community and the maintainers on the API design.

**The Background** :

Currently, `swift-nio-ssh` client handshakes are primarily geared toward static/in-memory private keys. For applications that need to integrate with local system credentials (such as standard `ssh-agent` , 1Password SSH Agent, or hardware signers like YubiKeys), we need a delegate hook pattern that can delegate signing operations during the authentication phase.

**What this PR introduces** :

- Adds hooks/delegates to allow external signing mechanisms to participate in the client handshake.
- Fully preserves backwards compatibility (public APIs are non-breaking).
- Includes unit test coverage for the hook delegation paths.

I have just rebased the branch onto the latest `main` so it is conflict-free and ready for CI (currently awaiting maintainer approval to trigger).

I know the SwiftNIO maintainers have a lot on their plate, so I want to make sure I’m heading in the right direction. If anyone has a few minutes to look at the API layout on GitHub and share feedback or suggestions, it would be greatly appreciated!

Thanks,  
Craig Munro
