This year I was learning two things at once. I was new to integrations (and Legora), and I was learning how to work with agents, while they kept getting better.
Over the last few months, our team has connected Legora to more than 30 tools, including document management systems, e-signature platforms, and business applications. Lauren Tan has written that "using agents well comes down to how well you're able to prime the agent's context window with high quality context." For integrations, most of that context lives outside our codebase: in how the other system behaves, and in the heads of the people who build and use it. Much of our work this year has been bringing it in where our agents can use it.
Some of it is in the docs
Docs are the easiest context to give an agent, so that's where we started. We gave our agents every vendor doc that might help, across versions and products, to use during development and review.
When I started working on integrations, I assumed the docs would have most of the answers, and on small fixes they did. Agents helped me read the docs, but I still wrote one small component at a time and tested each change by hand: signing in to the vendor's system, setting things up, and checking what Legora did.
Most of it is in someone's head
You learn most of what matters about another system by building against it.
I learned that when I worked on an integration where Legora had to reproduce much of another system's behavior. Some of what I found were differences between platforms that nobody had written down. Some were APIs with very little documentation, where the only way to know what happened was to try it. Sometimes the docs were simply wrong. You find these gaps by building a feature, watching it fail, and figuring out why. Once you do, the answer lives in your head, and maybe your reviewer's.
The rest is on calls
We also learn from our partners: vendors and customers. Over the past year, I've been on a lot of calls with both.
We talk to vendors' product, engineering, and support teams. They can read their own code, so they can confirm what the system actually does. They can explain the architecture behind it, and sometimes we work with them on new APIs.
Customers see something neither we nor the vendor can: how their lawyers actually use the system day to day. Their IT teams test in their own sandboxes and tell us what they find. Some of the most useful things I know about these integrations came from them, including behavior the vendor had never mentioned. By default, all of that stays with whoever was on the call.
Writing it down
Agents can't read what's in people's heads. Part of working AI-first has been writing it down deliberately, in the codebase, so every engineer and every agent can use it: code comments, and markdown files like AGENTS.md next to the code. As agents got better at working on their own, this mattered more, because an agent working without me can only use what we've written down.
A useful AGENTS.md entry says what the other system does, what an agent would wrongly assume from it, and what to do instead. One of ours explains that a not-found error from a vendor doesn't always mean something was deleted, so an agent shouldn't remove anything in Legora until the deletion is confirmed another way. In code comments, we also write down how we know something and when we checked it, so the next reader can tell what we've verified from what we've assumed.
We've also written down our past bugs. Integration bugs tend to come back in the same shapes, so I went through the integration fixes we'd shipped, grouped them into checks, and added them to the review and planning skills our agents use for integrations code. Each check links to the bugs behind it, so an agent or reviewer can see why it's there. To test it, I gave a fresh agent only the checks and a change we'd already merged that later caused a bug. It flagged the problem and suggested the fix we'd shipped. On a change that hadn't caused problems, it found nothing serious.
Notes can go stale. For some of our larger integrations, we also keep a fake version of the vendor's API that runs in our tests. It's a real HTTP server on localhost, and our production clients talk to it the same way they talk to the vendor, so tests cover auth, pagination, and parsing, not just our logic. Different deployments of the same product don't always behave the same way, so the fake has a switch for each one we've seen, and the same tests run against every version. When we learn something new about the real system, we add it to the fake, and every agent that works on the integration after that tests against it. The catch is that the fake only knows what we've taught it.
Letting agents test
The last step was letting agents look at the other system themselves.
For a while, I told my agents not to use computer use. They'd try a basic workflow and get stuck. I decided it was wasting my tokens and wrote a personal Cursor rule telling them to avoid it. A month later, I tried it end to end on a personal project and was shocked by how well it did, so I gave it another chance at work.
For integrations, that meant agents needed access to the other system. When I joined, our existing integrations were already set up in local development, so you could start testing without configuring anything. As we built new integrations, we did the same setup for each one and extended it to cloud agents. It took a long time, but it only has to be done once. Our developer experience team has made this much easier too: cloud agents start with the app running and signed in, and can sign in to a real vendor system with a test account full of synthetic data.
With that in place, an agent can test a change the way I would, in Legora and in the vendor's system. That lets us build and test several changes in parallel. It also gives us a loop for learning the vendor's system: an agent does something in the vendor's UI, records what our integration sees afterwards, and adds anything new to the fake.
Testing by hand doesn’t go away
Agents test a lot of my changes now, but I still test by hand and ask that of others. I want to understand our product and the integrations I work on myself, and part of that is using them. When a change is risky or the code is new to me, I click through it in Legora and in the vendor's system, the way a lawyer would.
That's how I build my own picture of how the two systems fit together. An agent can report what happened, but I want to know how it feels to use, and where it might confuse a lawyer. It's also how I figure out what to ask the vendor, what to add to the fake, and what to send an agent to look at.





