Skip to content

API Reference parrot.tools.stub_credentialed_tool

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.tools.stub_credentialed_tool

View source

Stub credentialed tool for FEAT-260 v1 acceptance testing.

:class:StubCredentialedTool is a minimal echo tool that declares a per-user credential requirement (credential_provider = "stub"). It exists solely to validate the A2A credential bridge end-to-end (suspend → consent link → OAuth callback → resume → result → audit) without a real IdP.

The tool is intentionally trivial: it echoes its message argument back as the result. Credential secrets MUST NOT appear in the output — the bridge applies standard output scrubbing; the stub relies on that seam and does not perform additional sanitisation.

Usage in tests::

from parrot.tools.stub_credentialed_tool import StubCredentialedTool
from parrot.a2a.server import A2AServer
from parrot.security.audit_ledger import AuditLedger, LocalHMACSigner

tool = StubCredentialedTool()
ledger = AuditLedger(signer=LocalHMACSigner())
server = A2AServer(
    agent,
    credential_resolvers={"stub": my_resolver},
    audit_ledger=ledger,
)
# agent.tools = [tool]

Alias AbstractTool

Re-exported from parrot.tools.abstract.AbstractTool.

Alias AbstractToolArgsSchema

Re-exported from parrot.tools.abstract.AbstractToolArgsSchema.

Class StubCredentialedTool

Minimal credentialed echo tool for A2A bridge integration tests.

Declares credential_provider = "stub" so that the A2A credential gate (FEAT-260 / TASK-1644) suspends the task and issues a consent link when the per-user stub credential has not yet been resolved.

When the credential IS resolved, the tool simply echoes the message argument back. The key_fingerprint of the resolved credential is written to the :class:~parrot.security.audit_ledger.AuditLedger.

Attributes:

Attribute Type Description
name Tool identifier used by the A2A gateway.
description Human-readable description sent to the LLM.
credential_provider str Declares that this tool requires a per-user credential from the "stub" provider.
args_schema Pydantic v2 model for tool input validation.

Attribute logger

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally