harnest-authentication
Implement or review Harnest request authentication, AuthPrincipal propagation, browser-token pass-through or exchange, CredentialProvider policy, and trusted tool or library credential use. Use for auth extensions and downstream authorization flows; not for model-provider API keys configured directly on model connectors.
- License 许可
- Apache-2.0
- 所属仓库
- Usefused/harnest
- 最近更新
- 2026-11-14
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- harnest-authentication
- description
- Implement or review Harnest request authentication, AuthPrincipal propagation, browser-token pass-through or exchange, CredentialProvider policy, and trusted tool or library credential use. Use for auth extensions and downstream authorization flows; not for model-provider API keys configured directly on model connectors.
02 资源文件 2
- 参考文档agents/openai.yaml256 B
- 参考文档references/contract.md2.2 KB
03 SKILL.md 正文
Harnest authentication
Build a tested trust path from an incoming connection to a downstream service without making credentials agent state.
Read references/contract.md before changing an auth or credential flow.
Sensitive data handling
Use placeholders, environment-variable names, and synthetic credentials when authoring code or testing; do not request or read real secret values. If supplied in conversation, omit them from generated files, replies, and tool arguments. Generated runtime code may validate incoming tokens or exchange them with the configured identity provider, and send credentials only to the authorized downstream audience. Keep them opaque until that trusted request boundary; never persist or expose their raw values to the model.
Required decisions
- Treat
@lifecycle.authenticateas the only raw connection boundary. Validate identity before returningAuthPrincipal. - Put selected non-secret authorization facts in
principal.claims. Wrap every promoted token or signed header inCredentialunderprincipal.credentials. Never copy the complete request. - Implement downstream policy in one root
CredentialProvider. Read identity, claims, and incoming credentials only throughrequest.principal; there is no copiedCredentialRequest.user_idfield. - In trusted tools, nodes, or
lib/, callcontext.credentials.resolve(fixed_audience, scopes)and reveal only while constructing the outbound request. Never make token, audience, or scopes model-generated arguments. - Prefer audience-specific token exchange. Permit pass-through only when the incoming credential is valid for that exact destination.
- Keep credentials out of prompts, context resources, metadata, state, sessions, checkpoints, tasks, logs, traces, and errors. Queued work stores a grant reference and resolves later.
Verification
Test invalid authentication, principal propagation, redacted representations, provider policy, root/subagent inheritance, revocation, and managed/native paths that changed. Finish with a local HTTP request using a synthetic token, proving that an incoming header reaches the provider only as the explicitly promoted opaque credential. Run the repository quality gate for Harnest source changes.
04 同仓库更多 Skills
company-support
Help employees resolve support requests using approved services.
company-builder
Build agents using the company support catalog and native Harnest contracts.
incident-triage
Triage customer-reported service incidents when production impact, errors, authentication failures, or integrations are mentioned.
harnest-studio
Configure Harnest Studio workspaces, loaded packs, company distributions, and builder model, endpoint, credential references, budgets, or CA settings. Use for Studio launch and pack configuration; use harnest-studio-ui for visual customization.
harnest-studio-ui
Customize Harnest Studio through UI packs: themes, layouts, isolated views, trusted modules, or shell replacements. Use for Studio styling, Tailwind or Panda CSS builds, section swaps, and UI recovery; not agent runtime configuration.
harnest-authoring
Build, modify, test, or review Harnest agents and source, including folders, APIs, frameworks, resources, extensions, plugins, lifecycle, MCP, skills, evals, compilation, running, and serving.