Methods marked "secret key" need SCUTE_SECRET. Hash answers are the API's JSON with string keys.
Scute::Client#
Scute::Client.new(app_id: ENV["SCUTE_APP_ID"], secret: ENV["SCUTE_SECRET"], base_url: ENV["SCUTE_BASE_URL"], transport: nil, client_ip: nil, open_timeout: 5, read_timeout: 10, retries: 1)| Member | Returns |
|---|---|
| app_id, client_ip, http | Readers |
| secret? | true when a secret is set |
| with_client_ip(client_ip) | A copy with another client IP |
| tokens | Scute::Tokens |
| users | Scute::Users::API |
| sessions | Scute::Sessions::API |
| authz | Scute::Authz::API |
| agents | Scute::Agents::API |
Scute::Tokens#
| Method | Returns |
|---|---|
| verify(token, remote: false) | Scute::Session; raises Scute::InvalidToken |
| public_app_id | The app's public id (app_...) |
Constants: KEYS_TTL = 600, REFETCH_AFTER = 60, LEEWAY = 30, ALGORITHMS = %w[RS256].
Scute::Session#
Data with user_id, app_id, workspace_id, expires_at, actor, claims. Methods: impersonated?, authz_context.
Scute::Users::API (secret key)#
| Method | Returns |
|---|---|
| list(**params) | Hash |
| get(id) | Hash |
| find_by_identifier(identifier) | Hash or nil |
| create(identifier, meta: nil) | Hash |
| invite(identifier, meta: nil) | Hash |
| update(id, **attributes) | Hash |
| activate(id), deactivate(id), delete(id) | Hash |
| previous_accounts(id) | Array |
| merge(id, from:) | Hash |
| impersonate(id, reason:, minutes: nil, actor_user_id: nil, actor: nil, challenge: nil, approval: nil) | Hash |
| impersonations(id) | Array |
| stop_impersonating(id, session_id: nil) | Hash |
Scute::Sessions::API#
| Method | Credential |
|---|---|
| current_user(access_token) | user's token |
| refresh(refresh_token) | user's refresh token |
| sign_out(access_token) | user's token |
| list(user_id) | secret key |
| revoke(user_id, session_id) | secret key |
Scute::Authz::API (secret key)#
| Method | Returns |
|---|---|
| check(user_id:, action:, resource: nil, context: nil, challenge: nil, approval: nil) | Scute::Authz::Decision |
| check_batch(checks) | Array of decisions (at most BATCH_LIMIT = 100) |
| permissions(user_id, resource: nil) | Hash |
| authorized_users(action:, resource: nil, limit: nil, offset: nil) | Hash |
| filter(user_id:, action:, resource_type:, context: nil) | Hash with filter |
| start_step_up(user_id:, decision: nil, permission: nil, method: nil) | The challenge Hash |
| snapshot | Hash with token, jwks, version |
| requests(status: nil, user_id: nil) | Array |
| create_request(user_id, role: nil, action: nil, resource: nil, duration: nil, reason: nil) | Hash |
| decide_request(id, verdict, reviewer_id: nil, note: nil) | Hash |
Scute::Authz::Decision#
Data with decision, reason, permission, roles, path, conditions, step_up, approval, agent, explanation, say. Predicates: allowed?, denied?, step_up?, needs_approval?. Decision.from_api(hash) builds one from an API answer.
Scute::Agents::API (secret key)#
| Method | Returns |
|---|---|
| list | Array |
| get(slug) | Hash |
| create(slug:, owner_user_id:, name: nil, description: nil, roles: nil, team_role: nil, settings: nil) | Hash |
| update(slug, **attrs) | Hash |
| delete(slug) | Hash |
| suspend(slug), resume(slug) | Hash |
| tasks(slug, status: nil) | Array |
| start_task(slug, acts_for: nil, actions: nil, resources: nil, requester: nil, ttl: nil, ref: nil, parent_task_id: nil) | Hash with token |
| complete_task(slug, id), revoke_task(slug, id) | Hash |
| assertion(slug, id) | Hash with assertion |
Scute::Authentication#
scute_authenticate!(remote: false), scute_session, scute_signed_in?, scute_user_id, scute_access_token, scute_client, scute_client_ip.
Scute::Authorization#
scute_authorize!(action, resource = nil, context: nil, challenge: nil, approval: nil), scute_can?(action, resource = nil, context: nil), scute_user_id, scute_client, scute_client_ip.
Scute::ClientIP#
HEADER, parse(value), parse!(value), with(value) { }, current, from_request(request), from_env(env), and Scute::ClientIP::Middleware.new(app).
Scute::Harness#
Scute::Harness.new(agent:, guards: nil, tools: {}, mode: :enforce, default_tier: :low, store: nil, client: nil, on_decision: nil, on_alert: nil, **client_options)| Member | Returns |
|---|---|
| agent, mode, guards, store, client | Readers |
| run(id: nil, acts_for: nil, task: {}, requester: nil, parent: nil, token: nil, session: {}, context: {}) | Scute::Harness::Run |
| spec(tool) | Scute::Harness::ToolSpec |
Stores: Scute::Harness::MemoryStore.new, Scute::Harness::CacheStore.new(cache). Both have get(key) and set(key, value, ttl = nil).
Scute::Harness::Run#
| Method | Returns |
|---|---|
| id, harness, tool_names | Readers |
| token, task_id, whoami | The task token, task id, task details |
| check(tool, args = {}, id: nil, messages: [], approved_by_user: false) | Verdict (kind, decision, args, message, say, results, call_id, tool, runs?) |
| after(tool, args, result, id: nil, messages: []) | What the model should see |
| wrap(tool, &block) | A lambda that checks, runs the block with the arguments, and returns the result or a message |
| ruby_llm(tool, chat: nil) | The guarded tool instance |
| ruby_llm_human_tools(methods: HumanTools::METHODS) | Array of RubyLLM::Tool |
| human_tools(methods: HumanTools::METHODS) | Hash of callables |
| start_verification(verdict: nil, method: nil, permission: nil) | Hash |
| submit_code(code, challenge_token = nil) | Hash |
| verification_status(challenge_token = nil) | Hash |
| complete_verification(challenge_token = nil) | Records a finished verification |
| approval_status(id) | Hash |
| confirm(tool, args) | Records the person's confirmation |
| request_plan(calls, reason: nil), plan_status | Hash |
| preview(tool, args = {}) | Scute::Authz::Decision |
| report_tools(definitions) | Hash with known, new, changed |
| property(name) | The secret's value |
| sign(name, claims: nil, data: nil) | Hash with jws or signature |
| session, verified_at | The run's session id, last verification time |
| ground(*values), identify(*values), identities, grounded_values | Grounding and requester values |
| record_usage(usd: 0), budget_exhausted?, allowed_tools(names = tool_names) | Budgets and tools |
| snapshot | What the run remembers, tokens masked |
| complete!, revoke! | Ends the task |
Scute::Harness::HumanTools::METHODS is %w[email_otp sms_otp totp entra_push].
Scute::Guards#
permissions(**), verify_person(**), approval(**), requester_only(**), grounding(**), args(rules, **), budget(**), content(**), decoy(tools, **), define(name, mode: nil, after: nil, &before). Keyword arguments are on Harness.
Errors#
Scute::Error, Scute::APIError, Scute::ConnectionError, Scute::ConfigurationError, Scute::InvalidToken, Scute::Unauthenticated, Scute::Forbidden. See Errors.