Victoria's Code STA / 01
EGP — build log

Governing the vendors you don't control

Most of the riskiest API calls a company makes go to someone else.

Take a lender. One loan application touches:

  • a credit bureau: regulated, and every pull costs money
  • a valuation service
  • an e-signature provider, where sending the envelope is a legal act
  • an SMS provider, which reaches a customer the moment it fires and can't be taken back
  • and now, more and more, an AI model

That's five vendors, each with its own credentials, its own logs, and its own idea of who's allowed to call it. Then compliance asks something that sounds easy:

"Who pulled this applicant's credit, and what did our vendors cost us yesterday?"

And the answer takes a week of digging through five systems. Ang sakit (painful).

I've been building a gateway for this kind of problem. It sits between the apps and everything they call, and every call has to go through it. It already covered the lender's own APIs. This round I pointed it at the vendors too, including the AI one. Three ideas did most of the work.

A vendor is just another service

The gateway already worked like this for the lender's loan API: each route maps to a named action, a policy decides yes or no, and every call is recorded. Adding vendors turned out to be config, not a redesign. Each vendor gets its own actions:

vendors.credit.pull
esign.envelope.send
comms.sms.send
ai.underwriting.assist

The apps calling them didn't change at all. Now policy decides per action:

  • Credit pulls: underwriters only, logged in detail. If a loan officer tries, they're denied, and the response names the policy and rule that said no. Not just "403 Forbidden". The actual reason.
  • Valuations: any lending staff. Low risk, no fuss.
  • Signature envelopes: this is a legal act, so it's treated like one. Contracts up to $50k go out right away. Bigger ones wait for a manager to approve before the envelope is sent. The approval happens before the thing you can't undo, and both get recorded.
  • SMS: normal messages go out right away. More than 25 recipients counts as a campaign and waits for a manager. So one stolen login or one bad for loop can't spam every customer. A held message is never sent and never billed.

That last part is what I keep coming back to. The gate doesn't just warn you. It actually stops the call.

Cost goes on the record

Each vendor route has a fee set in config: $2.50 per credit pull, $0.05 per SMS, and so on. (Demo numbers.) The gateway writes that fee onto the call's record, with one rule:

Only if the call actually went through.

Denied and held calls never reached the vendor, so they cost nothing. That rule is what makes the total mean something. Add up a day and you get money actually spent, broken down by call, person, and vendor, on the dashboard before the invoice arrives.

It also means every denial costs exactly zero, which is the easiest compliance argument I know: a blocked call is money you can prove you didn't spend.

The AI vendor gets no special treatment, and that's the point

The AI underwriting service sits behind the gateway like any other vendor. That turns out to be the whole AI governance story in small:

  • Policy decides who can use it. Underwriters yes, interns no.
  • Policy decides when a person has to step in. AI help on a normal loan goes through right away. AI on a loan over $100k waits for a credit director to approve. A human gets involved where the stakes call for it, not on every call and not on none of them.
  • Every call is recorded with a fingerprint (hash) of what was sent. That gives you a tamper-evident list of what went to the model, who sent it, and what it cost. "Shadow AI" is really a problem of not knowing what's being used, and this list builds itself.

The model only gives advice. The lender's own policy makes the decision. None of this needed anything AI-specific, and to me that's a sign the general approach is right. If you need one whole system to govern AI and a different one to govern your other vendors, one of them is probably wrong.

Sensitive data doesn't get out

The newest piece runs before any of that. It checks everything going out and blocks personal data like Social Security numbers and card numbers, in any text field, however deeply nested. An email with an SSN in the body comes back 403 inspection-blocked and never reaches the SMS vendor.

The detail I'm proudest of: the record says which field had the problem, but never what was in it.

That record goes into the audit trail. If it quoted the SSN it just blocked, the audit trail would become the leak. You'd have a compliance feature creating the exact problem it's supposed to stop. So the record is clean from the start, not because someone remembered to redact it later.

What I'm not claiming

  • The vendors in the demo are fake. They return fixed responses shaped like a credit bureau, an e-sign service, an SMS provider, and an AI model. The gate in front of them is real. The vendors behind it are not.
  • The data checker is pattern matching, not magic. It catches accidents, which in my experience is most of the real problem. It won't stop someone who is deliberately disguising the data to get past it.
  • The fees are numbers I set in config, not real billing. The total is what the gateway priced, not what the vendor will actually charge.
  • AI built into code editors (the autocomplete kind) doesn't go through a gateway at all. This works best for APIs, services, and agents, and I'd rather say that than pretend it covers everything.
  • This is a dev setup with demo services. Not production.

The takeaway

Vendor governance usually means a spreadsheet of contracts and a yearly review. Sending every real call through a real gate changes what you can say. Instead of:

"We reviewed this vendor last quarter."

You can say:

"This call, at 2:14pm, was allowed under this rule, cost this much, and here's the sealed record."

That works the same whether the vendor sells credit reports or an AI's opinion. And that, more than any AI-specific feature, is what makes AI something you can actually govern.


This is a platform in active development. What you're reading is the current design and honest results, not shipped software. It has a name, and I'll share it once there's something worth putting it on.

Comments

Thoughts?

Comments are threads on GitHub, so a GitHub account is needed to post. No account? Email me instead — I read everything.