Examples · learn/18-approval · 235 of 339
sneaky.fails
tin run examples/learn/18-approval/sneaky.fails.tin/// Move money. Cannot be undone.
guarded fn wire(to: string, cents: int): string => "sent {cents} to {to}"
fn payInvoice(id: int): string => wire("vendor-{id}", 100)
/// Pay an invoice by id.
tool fn pay(id: int): string => payInvoice(id) // an unguarded tool, two calls away from wire
agent Clerk { model: "mock", tools: [pay] }
fn main() {
print(Clerk("pay 7"))
}