MODULE 10 · LESSON 10.3
Enable the optional connections broker
Enable connections only for agents that need external credentials.
Lesson 55 of 86 · FabrCore 2.0
Overview
The optional broker protects grants and resolves tokens in trusted infrastructure. A profile names the owner, provider, allowed agent handles and resources. Credential references point to host-resolved secrets; profiles and blueprints should not contain raw tokens.
Profiles describe permitted use, not secret values
A connection profile identifies its owner, provider, allowed agent handles and resource requirements. Its credential reference points to secret material resolved by trusted Host infrastructure. The profile can be inspected or versioned without making a token part of an agent prompt or blueprint. The optional broker protects grants and performs the actual token resolution.
Bootstrap protection remains infrastructure work
The broker needs its supported storage and data-protection configuration before it can protect user grants. Deploy its package/registration and key material deliberately; a Cloud Server editing an ordinary profile cannot install the assembly or manufacture the key ring. Read capability discovery before presenting connection controls in a console.
Enable and configure the connection broker
- Register the contracts/client, host broker and appropriate data protection. Enable remote agents and Agent ID separately only when needed.
- Create a connection profile with exact owner and allowed full handles, authority/client ID, resource base URLs/scopes and host credential reference.
- Choose authorization code, OBO or application credentials deliberately. Use conditional profile writes; changes invalidate prior authorization/bindings.
using FabrCore.Host;
using FabrCore.Services.Connections;
using FabrCore.Services.RemoteAgents;
builder.AddFabrCoreServer(new FabrCoreServerOptions {
AdditionalAssemblies = [typeof(ConnectionsExtensions).Assembly,
typeof(RemoteAgent).Assembly]
});
builder.Services.AddFabrCoreConnections(o => {
o.Enabled = true;
o.EntraAgentIdEnabled = false;
o.ClientHandoffEnabled = false;
});
builder.Services.AddFabrCoreRemoteAgents(o => o.Enabled = true);
// Also configure the host's normal user authentication/authorization.
var app = builder.Build();
app.UseFabrCoreServer();
app.MapFabrCoreConnections();
app.Run();
{
"FabrCore": {
"DataProtection": {
"ApplicationName": "my-cluster-production",
"CertificatePath": "/run/secrets/fabrcore-protection.pfx"
}
}
}
var mail = new ConnectionProfile {
Name = "mail-service",
Enabled = true,
Provider = "microsoft",
Authentication = ConnectionAuthentication.ClientCredentials,
Authority = $"https://login.microsoftonline.com/{tenantId}/v2.0",
ClientId = appRegistrationClientId,
CredentialReference = "mail-application",
AllowedAgents = ["alice:mail-agent"],
Resources = new() {
["graph"] = new() {
BaseUrl = "https://graph.microsoft.com/v1.0/",
Scopes = ["https://graph.microsoft.com/.default"]
}
}
};
await admin.SaveAsync("mail-service-principal", mail, "*");
Check availability, profile and credential resolution
- Start the Host with the connection integration and required storage/protection settings. Inspect advertised capabilities to confirm the feature is available.
- Create a test profile owned by the intended principal with one allowed agent/resource. Read the profile back and confirm it contains a credential reference, not a raw bearer token.
- Attempt a permitted resolution and an unpermitted agent/resource request. The latter must fail even if the profile exists and the operator can view it.
This checks feature availability and the authorization contract around token access. It does not complete interactive user consent by itself.
If the result is different
App-only connections may reacquire tokens without human login. Disconnect local authorization and disabling the application profile are different actions.
Go deeper
Explore the related documentation.