一键导入
a2a-workflow
Use when working on safeguard-ps A2A registrations, certificate authentication, credential retrieval, brokering, or A2A event listeners.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when working on safeguard-ps A2A registrations, certificate authentication, credential retrieval, brokering, or A2A event listeners.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when working on Azure Pipelines builds, version stamping, signing, publishing, or release artifacts for safeguard-ps.
Use when making Safeguard API calls, working with Invoke-SafeguardMethod, using filters or query parameters, exploring the API via Swagger, or troubleshooting API errors. Covers REST conventions, cmdlet preference, query/filter syntax, and common pitfalls.
Use when setting up test objects on a Safeguard appliance for integration testing. Covers the creation sequence for users, assets, accounts, certificates, A2A registrations, and cleanup.
Use when working on module internals, understanding the module manifest, SignalR event listeners, dynamic groups, custom platform scripts, or tracing how feature modules interact with the root module and global state.
Use when creating a new PowerShell feature module (.psm1), adding new exported cmdlets, or extending the module manifest. Includes step-by-step checklists, file templates, and manifest update procedures.
Use when running tests, writing tests, investigating test failures, or setting up a test environment against a live Safeguard appliance. Covers the integration test framework, test runner commands, suite structure, assertion patterns, and module-to-suite mapping.
| name | a2a-workflow |
| description | Use when working on safeguard-ps A2A registrations, certificate authentication, credential retrieval, brokering, or A2A event listeners. |
Use this skill when you need to configure Safeguard A2A from PowerShell, retrieve credentials with mutual TLS, broker access requests, or keep long-running handlers in sync with A2A events.
A2A in safeguard-ps is the certificate-authenticated application-to-application path for retrieving or updating managed credentials without using a bearer token session. The management-side cmdlets in src\a2a.psm1 create and maintain A2A registrations under Core/A2ARegistrations, while the caller-side cmdlets in src\a2acallers.psm1 use a client certificate plus an A2A <ApiKey> authorization header against the /service/a2a/v4/... endpoints. The module supports direct credential retrieval, bidirectional updates, access-request brokering, and real-time SignalR listeners.
Before any caller workflow works, the appliance-side A2A service must be enabled.
Useful cmdlets here are Get-SafeguardA2aServiceStatus, Enable-SafeguardA2aService, and Disable-SafeguardA2aService.
Typical check:
Get-SafeguardA2aServiceStatus -Appliance <address> -Insecure
Enable-SafeguardA2aService -Appliance <address> -AccessToken $token -Insecure
The A2A registration points at a certificate-authenticated Safeguard user.
Relevant evidence in the repo:
samples\certificate-user-demo.ps1 shows certificate-user creation with a thumbprintPrimaryAuthenticationProvider = @{ Id = -2; Identity = <thumbprint> }test\TestData\CERTS\A representative flow is:
Install-SafeguardTrustedCertificateThe tests use this sequence with RootCA.pem, IntermediateCA.pem, and UserCert.pfx.
Use the management cmdlets in a2a.psm1:
New-SafeguardA2a "Ticket System" TicketSystemUser -Description "Ticket System Requester" -VisibleToCertificateUsers
Get-SafeguardA2a "Ticket System"
Edit-SafeguardA2a "Ticket System" -Description "Updated description"
Key management cmdlets are New-SafeguardA2a, Get-SafeguardA2a, Edit-SafeguardA2a, and Remove-SafeguardA2a.
After the registration exists, add retrievable accounts and fetch the generated API key:
Add-SafeguardA2aCredentialRetrieval "Ticket System" <asset> <account>
Get-SafeguardA2aCredentialRetrieval "Ticket System" <asset> <account>
Get-SafeguardA2aCredentialRetrievalApiKey "Ticket System" <asset> <account>
Other useful management helpers are Reset-SafeguardA2aCredentialRetrievalApiKey, Get-SafeguardA2aCredentialRetrievalInformation, Set-SafeguardA2aCredentialRetrievalIpRestriction, and Clear-SafeguardA2aCredentialRetrievalIpRestriction.
The caller cmdlets Set-SafeguardA2aPassword and Set-SafeguardA2aPrivateKey write new secrets back through A2A. The integration tests explicitly create registrations with BidirectionalEnabled = $true by calling Invoke-SafeguardMethod directly, because New-SafeguardA2a does not currently expose that flag. If your workflow needs caller-side secret updates, verify the registration is configured for bidirectional use.
Every caller cmdlet uses one of three mutual-TLS modes:
-CertificateFile [-Password]-Thumbprint-CertificateObject-CertificateObject is worth preferring for integrations that load certificates from another secret store, because the help text explicitly calls out in-memory X509Certificate2 use without persisting a PFX to disk.
If you use -CertificateFile without -Password, the file-based cmdlets prompt with Read-Host -AsSecureString.
Get-SafeguardA2aRetrievableAccount enumerates the accounts a certificate user can retrieve. It returns an object that includes:
AppNameDescriptionDisabledCertificateUserCertificateUserThumbprintApiKeyAssetNameAccountNameDomainNameThat makes it the quickest way to discover which API key maps to which account.
Password flow uses Get-SafeguardA2aPassword and Set-SafeguardA2aPassword. SSH key flow uses Get-SafeguardA2aPrivateKey and Set-SafeguardA2aPrivateKey, with -KeyFormat OpenSsh|Ssh2|Putty when needed. API key secret retrieval uses Get-SafeguardA2aApiKeySecret.
Representative examples from the help:
Get-SafeguardA2aPassword <appliance> <apiKey> -Thumbprint <thumbprint> -Insecure
Get-SafeguardA2aPassword <appliance> $apiKey -CertificateObject $cert
Get-SafeguardA2aPrivateKey <appliance> $apiKey -CertificateObject $cert -KeyFormat Putty
Set-SafeguardA2aPassword <appliance> $apiKey -CertificateObject $cert -NewPassword $securePassword
Set-SafeguardA2aPrivateKey <appliance> $apiKey -CertificateObject $cert -PrivateKey $key
Use the a2a.psm1 cmdlets when you are configuring or auditing registrations rather than calling them:
Get-SafeguardA2aCredentialRetrievalAdd-SafeguardA2aCredentialRetrievalRemove-SafeguardA2aCredentialRetrievalGet-SafeguardA2aCredentialRetrievalApiKeyReset-SafeguardA2aCredentialRetrievalApiKeyGet-SafeguardA2aCredentialRetrieval supports:
-QueryFilter-Fields-OrderByThe test suite covers both valid and invalid filter cases, so malformed filters should be treated as user input errors, not as a signal to silently retry with a different shape.
A2A brokering is supported.
Management-side broker cmdlets in a2a.psm1 are Get-SafeguardA2aAccessRequestBroker, Set-SafeguardA2aAccessRequestBroker, Clear-SafeguardA2aAccessRequestBroker, Get/Set/Clear-SafeguardA2aAccessRequestBrokerIpRestriction, and Get/Reset-SafeguardA2aAccessRequestBrokerApiKey.
Set-SafeguardA2aAccessRequestBroker requires at least one of:
-Users-GroupsIt also validates every -IpRestrictions value with Test-IpAddress before sending the PUT.
Caller-side request creation lives in New-SafeguardA2aAccessRequest.
Important parameters supported by that cmdlet:
-ApiKey-ForUserName or -ForUserId-AssetToUse/-AccountToUse or -AssetIdToUse/-AccountIdToUse-ForProviderName-Emergency-ReasonCode-ReasonComment-TicketNumber-RequestedFor-RequestedDurationDays|Hours|MinutesAccepted access request types include these aliases:
PasswordSSHKey or SSHRemoteDesktop or RDPRemoteDesktopApplication, RDPApplication, or RDPAppTelnetAPIKeyFileThe help text notes that brokering creates the access request on behalf of another user and the target user will then be notified via SignalR.
Wait-SafeguardA2aEvent is the low-level real-time listener. It:
/service/a2a/signalr/You can use it in three modes:
-Handler { ... }-HandlerScript <path>If no handler is provided, it emits PSCustomObject items with EventName and EventBody.
Example:
Wait-SafeguardA2aEvent <appliance> $apiKey -Thumbprint <thumbprint> -Insecure -Event AssetAccountPasswordUpdated
Invoke-SafeguardA2aPasswordHandler:
InitialPasswordAssetAccountPasswordUpdatedInvoke-SafeguardA2aSshKeyHandler:
InitialSshKeyAssetAccountSshKeyUpdated-KeyFormat OpenSsh|Ssh2|PuttyThese handler cmdlets require exactly one of -Handler or -HandlerScript.
Invoke-SafeguardA2aMethodWithCertificate contains an explicit Windows warning: even when you provide a PFX file, the issuing CA may still need to be installed in the Intermediate Certificate Authorities store or Windows may fail to send the client certificate during the HTTPS handshake.
Also watch for:
Certificate with thumbprint '<value>' not found in CurrentUser\My store-CertificateFileInstall-SafeguardTrustedCertificateCommon checks:
Get-SafeguardA2aServiceStatusGet-SafeguardA2aGet-SafeguardA2aCredentialRetrievalGet-SafeguardA2aCredentialRetrievalApiKeySet-SafeguardA2aPassword or Set-SafeguardA2aPrivateKeyThe listener code throws on these usage errors:
You must specify -Handler or -HandlerScriptYou may specify -Handler or -HandlerScript but not bothHandler script not found: <path>For Wait-SafeguardA2aEvent, fatal 4xx-class errors are treated as non-retryable; other connection failures log a warning and reconnect with backoff.
Get-SafeguardA2aCredentialRetrieval surfaces bad -QueryFilter input as an error.Set-SafeguardA2aAccessRequestBroker throws if neither -Users nor -Groups is supplied.-Verbose.Wait-SafeguardA2aEvent before layering on the password or SSH-key handlers.