Skip to main content

An API. A Python SDK. A command line. Scripts. Seal for developers. Your own tools, on the record.

The v3 API, in beta, with a Python SDK and the seal command. Scripts that run in Seal, apps on an entity's page, and Neil set up from code.

A Script called Expiry sweep in Blubber Biologics' Materials system, as Seal shows it after run 14 on Mon 16 Nov at 08:02. On the left the script, twenty-four lines of Python using Seal's SDK: it lists the raw material lots whose expiry is within fourteen days and that are not quarantined, prints how many there are, opens a changeset called Expiry sweep, and stages each lot as quarantined. On the right the run's log: three lots, RM-2041, RM-2047 and RM-2052, staged in a changeset of three entities awaiting publication, and the run finished in 1.9 seconds
Materials › Scripts › Expiry sweep
Run finishedv3
Expiry sweep
Run 14, Mon 16 Nov 08:02
expiry_sweep.pyPublished by T. Nakamura
  1. 1import seal
  2. 2from datetime import date, timedelta
  3. 3
  4. 4soon = date.today() + timedelta(days=14)
  5. 5lot = seal.entities.list(
  6. 6 where={"kind": "template", "title": "Lot"}
  7. 7).one()
  8. 8lots = seal.entities.list(
  9. 9 system="materials",
  10. 10 where={
  11. 11 "template": lot.id,
  12. 12 "fields": {
  13. 13 "Expiry": {"lt": soon.isoformat()},
  14. 14 "Quarantined": False,
  15. 15 },
  16. 16 },
  17. 17)
  18. 18print(f"{lots.total} lots expire by {soon}")
  19. 19
  20. 20with seal.changesets.create(name="Expiry sweep"):
  21. 21 for row in lots:
  22. 22 quarantined = {"Quarantined": {"value": True}}
  23. 23 seal.entities.update(row.id, fields=quarantined)
  24. 24 print("Staged", row.title)

Run 14

As T. Nakamura
  • Run 14, by T. NakamuraRun
  • 3 lots expire by 2026-11-30print
  • Staged RM-2041print
  • Staged RM-2047print
  • Staged RM-2052print
  • Expiry sweep, 3 entities, awaiting publicationChangeset
  • Finished, 1.9 sRun
A Script is an entity in Seal: versioned, changed in a changeset, and run in Seal's own runtimeIt runs as the person who runs it, with their access. The SDK is already signed inEvery write is staged in a changeset. Nothing takes effect until a person publishes itThe log is kept with the runRun 14, Mon 16 Nov 08:02. Three lots to quarantine, for QA to publish

Staged, then published by a person

Today an integration holds an admin login and writes straight into the database. Here it holds a key, and stages work a person publishes.

Compared onTodaySeal
A keyA shared admin loginIts systems, the lowest access, no signature
A writeStraight into the databaseStaged in a changeset a person publishes
A scriptOn someone's laptopIn Seal, as the person who runs it
A dashboardAn export to a spreadsheetAn app on the entity's page
A coding agentGuessing from a wikiGiven the guide Neil works from

A key signs nothing

A key is granted its systems and the lowest access that does the job. It can't publish, sign, create a key or make an admin.

The API key called LIMS bridge in Blubber Biologics' Settings, under API keys, on Mon 16 Nov at 08:40. On the left what it may do: specific systems, Materials and Quality, as a Member of each; Changeset publishing off; Sign-off steps off; and it can never create a key or an admin. On the right what it did today: read 212 lots in Materials at 06:30, staged 12 results on lot RM-2052 at 07:55 in a changeset called LIMS results awaiting publication, which L. Haddad published at 08:40
Settings › API keys › LIMS bridge
Shown once
LIMS bridge
Created by C. Whitlock, Mon 2 Nov
What it may doNothing else
  • SystemsSpecific systems
  • MaterialsMember
  • QualityMember
  • Changeset publishingOff
  • Sign-off stepsOff
  • Creates keys or adminsNever

Today

Mon 16 Nov
  • Read 212 lots in MaterialsRead
  • Staged 12 results on RM-2052Staged
  • LIMS results, 16 Nov, awaiting publicationChangeset
  • Published by L. HaddadPerson
Specific systems, and the lowest access that does the jobChangeset publishing off: the key stages work, and a person publishes itSign-off steps off: the key signs nothing. On, a step it gives is confirmed by the key, never an electronic signatureIt can't create a key or make anyone an admin, and every write it makes is in the audit historyLIMS bridge, created by C. Whitlock on Mon 2 Nov. The key was shown once

Your own app, on the entity's page

An app is an entity: HTML and TypeScript, versioned, published like any change, and run on the page with the person's own access.

A custom app called Expiry board on its own page in Blubber Biologics' Materials system, version 3, on Mon 16 Nov. On the left the app as it draws itself: four raw material lots that expire within thirty days, RM-2041 Polysorbate 80 on Thu 19 Nov in 3 days, RM-2047 Sucrose on Mon 23 Nov in 7, RM-2052 Histidine on Sat 28 Nov in 12 and RM-2058 WFI on Wed 9 Dec in 23. On the right its files, index.html, app.ts and styles.css, built in bun mode, reading window.SEAL_CONTEXT, and its versions: version 3 published by L. Haddad on Thu 12 Nov, and version 4 in a changeset called Board by material
Materials › Apps › Expiry board
v3
Expiry board
Custom app
Expiring in 30 daysMon 16 Nov 08:45
4 lots, soonest first3 staged as quarantined
LotMaterialExpiryDays
RM-2041Polysorbate 80Thu 19 Nov3
RM-2047SucroseMon 23 Nov7
RM-2052HistidineSat 28 Nov12
RM-2058WFI, drumWed 9 Dec23

The app

3 files
  • index.html1.2 kB
  • app.ts3.8 kB
  • styles.css0.9 kB
  • Modebun
  • Readswindow.SEAL_CONTEXT
  • Published by L. Haddad, Thu 12 NovActive
  • Board by material, T. NakamuraChangeset
It runs in a sandboxed frame on the entity's page, and reads Seal from window.SEAL_CONTEXTAn app is an entity: its files, versioned, changed in a changeset and published like any changeFlat, square, 13px: it reads as part of Seal, not a widget bolted onExpiry board, version 3, on its own page in Materials

Neil, set up from code

A persona, a connection and a routine, from the SDK. A person authorises the connection, and the routine is set up as a person.

Neil's routine called overdue-deviations in Blubber Biologics' Seal on Mon 16 Nov at 08:00. On the left the Python that set it up with Seal's SDK: a persona called QA with its instructions, a Gmail connection whose authorisation link is printed for a person to open, and a routine that runs weekdays at 08:00 in Europe/London and asks Neil, as QA, to list deviations past their due date and draft a reminder to each owner. On the right the routine as Seal shows it: its schedule, its persona, its connection authorised by L. Haddad, who set it up on Fri 13 Nov, and this morning's run, four deviations overdue and four reminders drafted, waiting for L. Haddad to send
Neil › Routines › overdue-deviations
Ran at 08:00
overdue-deviations
Weekday check of overdue deviations
setup.pyRun once, as L. Haddad
  1. 1import seal
  2. 2
  3. 3seal.personas.create(
  4. 4 "QA",
  5. 5 "Review deviations and CAPAs. Say what "
  6. 6 "evidence is missing and who needs to act.",
  7. 7)
  8. 8gmail = seal.connections.connect("gmail")
  9. 9print(gmail["authorizationUrl"]) # open within 15 min
  10. 10
  11. 11seal.routines.create(
  12. 12 name="overdue-deviations",
  13. 13 description="Weekday check of overdue deviations.",
  14. 14 trigger={
  15. 15 "kind": "schedule",
  16. 16 "schedule": {
  17. 17 "kind": "cron",
  18. 18 "expression": "0 8 * * 1-5",
  19. 19 "time_zone": "Europe/London",
  20. 20 },
  21. 21 },
  22. 22 action={
  23. 23 "kind": "neil_prompt",
  24. 24 "prompt": "List deviations past their due date "
  25. 25 "and draft a short reminder to each owner.",
  26. 26 "persona": "QA",
  27. 27 "connections": [gmail["id"]],
  28. 28 },
  29. 29)

The routine

Active
  • RunsWeekdays at 08:00, Europe/London
  • PersonaQA
  • ConnectionGmail, authorised by L. Haddad
  • Set up byL. Haddad, Fri 13 Nov
  • 4 deviations overdue, 4 reminders draftedRun
  • Drafts wait for L. Haddad to sendGmail
A persona is Neil with instructions, made from code as from the pageA connection is authorised by a person in their browser, within 15 minutes. The code gets the linkA routine is a schedule and a prompt. It is set up as a person: an API key is refusedIt ran at 08:00. Four deviations are overdue, and four reminders wait for L. Haddadoverdue-deviations, Mon 16 Nov 08:00. Four reminders drafted, for L. Haddad to send

Your coding agent, signed in as you

seal login gives the command line a token of your own, and seal skill install gives your agent the guide Neil works from.

T. Nakamura's terminal on Mon 16 Nov: seal login with Blubber Biologics' Seal address opens Settings, API keys, in the browser to allow it, and the token is saved in the credentials file; seal whoami answers T. Nakamura, blubber; seal skill install puts Seal's guide in the skills folder; and a coding agent is asked which lots in Materials expire this month and are not quarantined, and to stage them for QA
Terminal
  1. $ seal login https://platform.seal.run/o/blubber
  2. Opening Settings, API keys, in your browser. Select Allow.
  3. Signed in as T. Nakamura. Saved in ~/.seal/credentials
  4. $ seal whoami
  5. T. Nakamura, blubber
  6. $ seal skill install
  7. ~/.seal/skills/seal-guide/
  8. › Which lots in Materials expire this month and
  9. are not quarantined? Stage them for QA.
seal login opens Settings, API keys, in your browser. Allow, and the token goes straight back to the commandThe token is yours: your access, as it changes, revoked in Settings. SEAL_API_KEY takes precedence when it is setseal skill install puts the API reference and guides where an agent on your computer reads themYour agent then works as Neil does: what it stages takes effect when a person publishes itT. Nakamura's terminal, Mon 16 Nov 08:50. Signed in, the guide installed, an agent at work in Materials

Questions about Seal for developers.

Is the API ready to build on?

The v3 API is in beta: a route or an SDK call may still change before general availability. Customers build on it today. Tell support@seal.run before a business-critical integration depends on it, so a change reaches you first.

Can a script or a key sign anything?

No. An API key can't give a human electronic signature, and nothing it does is one. Where Seal has turned sign-off steps on for a key, each step it gives is recorded as confirmed by the key, by name, never as a signature. A Script runs as the person who runs it, and signs nothing on their behalf.

What does a write do?

It is staged. A key or a script opens a changeset, names it, and puts its writes in it; the changeset goes through the same review, Checks and publication as one a person makes. With Changeset publishing off, which is the default, a person publishes it in Seal.

How do we get the SDK?

From Seal, matched to your deployment: the Python SDK and the seal command are one package, for Python 3.10 or later, and it is not on PyPI yet. The interactive reference is at /api/docs/v3 on your own Seal, with its OpenAPI description beside it, once you are signed in.

Is there a TypeScript SDK?

Inside a custom app, yes: an app built in bun mode imports Seal's TypeScript SDK and queries the record from the entity's page. Elsewhere, TypeScript and every other language call the HTTP API, where every route is under /api/v3, errors have one shape and pages have a cursor.

Where does a Script run?

In Seal's own sandboxed runtime, as the person who runs it, with their access and the SDK already signed in. It can run on its own, from an entity's page, or on a trigger such as a step being rejected, and its log is streamed and kept with the run.

Which region does it call?

Your own. The API root is https://platform.seal.run/api in the EU, https://us.platform.seal.run/api in the US and https://au.platform.seal.run/api in Australia, and the CLI saves the right one when you sign in.

Can we test against a copy first?

Yes. Where your organisation has isolated environments, a key can be bound to one, and then works only inside it, never against production. It expires after 90 days and is revoked when the environment is archived.

Seal Edge or the API?

Seal Edge is for equipment, instruments and your historian: a computer on your network reads them, and nothing is written by you. The API is for code you write, against the record, from wherever it runs. A plant with both has its readings and its tools on the same record.

Can our coding agent use it?

Yes. seal login gives the command line on your computer a token of your own, and seal skill install puts Seal's API reference and guides where an agent on that computer reads them. It then reads and stages work as you, and a person publishes what it stages.

See your process in Seal.

Working 48 hours after we agree its scope: tested, with evidence your QA approves.