Ruby
Verify Syncanix agent intents in Ruby — Rails and any Rack app — with a local HMAC check on every tool call.
The Ruby SDK offers a Rails controller concern and Rack middleware over a shared VerifyIntent core. Include the concern on your tools controller and read the verified payload from the intent it exposes.
Install
Add the package to your project with your language's package manager.
bundle add syncanix-sdk-railsConfigure the secret
The SDK verifies intents with your tenant's intent-signing secret. Store it as an environment variable — never commit it to source control — and load it where you register the SDK.
export SYNCANIX_INTENT_SECRET="your-intent-signing-secret"Verify intents
Register the SDK on the routes that expose agent actions. It verifies the X-Syncanix-Intent header before your handler runs, rejects any invalid or replayed call with a 403, and hands your handler the verified payload — including the acting tenant and user.
class ToolsController < ApplicationController
include SyncanixSdk::Rails::VerifyIntentConcern
syncanix_verify_intent secret: ENV['SYNCANIX_INTENT_SECRET']
def refund
render json: { tenantId: @syncanix_intent.tenant_id }
end
end