surfingdog.pt

Concept paper · surfingdog.pt · 8 November 2026

Published rules, AI applications and AI review

A model for the Portuguese State

Abstract

Portugal can let every person and business deal with the State through their own AI, without new forms. It needs gates in front of the registers it already keeps, and its rules published where an AI can read them. This paper sets out how, what it would save, and the safeguards it needs.

The proposal in brief

We ask the State to do five things, one body at a time. Who decides, and under which procedure, stays as the law sets it.

  1. Put gates in front of the registers it already keeps. Each fact lives in one base register, kept by the body legally responsible for it. A read gate serves it; a write gate guards it. Every gate speaks the same standard protocols, such as MCP.
  2. Publish the rules where an AI can read them. Laws, regulations and municipal master plans (PDMs) are served by the read gate, signed, versioned and linked to the official text in the Diário da República. Nothing outside the published rules can be demanded.
  3. Accept a complete file from anyone's AI. A citizen or business whose AI has read the rules files the complete case in the body's intake. There is no new form, and how a person works with their AI is their own business.
  4. Let a signed decision open the write gate, not a key. Each body publishes in advance what its AI may decide alone. By default, AI may approve clear cases but never refuses alone.
  5. Switch off the software in between. Every gate ships with a switch-off date for the forms, portals and back offices it replaces, and the savings are tracked in public contract data year by year.

Where Portugal starts

The State's IT is many separate systems, bought one at a time. Our map of Portuguese public IT counts 594 systems and organisations and 1,080 documented links between them.

Public bodies signed €10.71bn of IT contracts from 2012 to October 2026, in 162,272 contracts published on Portal BASE. The yearly value grew almost sevenfold, from €219M in 2012 to €1,510M in 2025, while IT stayed between 5.8% and 7.9% of all published contract value.

2012Highest: 2025, €1,510M
2012: €219M2013: €280M2014: €329M2015: €334M2016: €303M2017: €453M2018: €528M2019: €620M2020: €698M2021: €925M2022: €1,034M2023: €988M2024: €1,331M2025: €1,510M
1213141516171819202122232425
IT contract value by signing year, 2012–2025, € millions. Portal BASE open data (IMPIC), exported October 2026; our analysis. Contract value by signing year, not yearly spending.

The ten largest buyers account for 35% of IT contract value. The largest are the Tax and Customs Authority (€763.5M), the Ministry of Health's shared-services body SPMS (€699.7M) and the social-security IT institute (€502.0M).

Three lessons from our earlier work shape the proposal:

  • The software was never the hard part. Our demonstrators reached decisions in milliseconds. The hard part was the data and the rules: who holds the authoritative fact, which rule applies, and who may read it.
  • Quality has to be checked where data enters. The public contracts register accepted contracts lasting over 100 years, and a €147bn base price on a €147k purchase.
  • "Open" data leaks. In those open contracts we found people's tax numbers in the free text of 2,392 contracts, and people's names in at least 8,002.

The model

Everything is decentralised: each body runs its own gates and registers. The only shared things are the protocols, the rules for quality and access, and a plain address book of services.

The model: one public body, two gates.
  • Base register. One authoritative source per fact: people, companies, properties, addresses, licences. Others ask instead of copying.
  • Read gate. Serves data at the level each purpose needs, and the body's rules, so an AI can prepare a complete file.
  • Intake and decision. The file waits apart from the register. AI, staff or both decide under a policy the body publishes in advance.
  • Write gate. Sits in front of the database. Only approved data, from authorised writers and in good shape, gets in.
  • Notices. When a fact changes, the register tells the bodies entitled to know. Supervisors ask registers instead of collecting reports.
  • Address book. A list of every public service and where its gates are. It holds no data and decides nothing.

Asking, proving and applying

Many dealings with the State are only questions. Asking and proving are the light paths: they never touch an intake and never write. Applying is the exception, and even an application is mostly made of asks.

Three ways to deal with the State.

A gate never hands over a whole record: it answers the question asked, at the level the purpose allows. A signed proof, such as the European Digital Identity wallet will carry, lets you prove a fact without the State learning who checked it.

No new forms

The legal process stays as the law sets it. What goes is the form, the retyping of what the State already knows, the paper, and the back and forth.

Today and with your AI, step by step.

StepTodayWith your AI
1Find the right form, often on a different portal for each serviceYour AI reads the rules and the data through the body's read gate
2Type in what the State already knowsIt prepares the complete file and checks it against the same rules the official uses
3Attach documents that other public bodies issuedThe facts come from the registers; the file carries a digital signature
4For many acts, go in person: paper originals, certified signatures, a notaryIt files the case in the body's intake, under the procedure the law already sets
5Officials check everything by hand against the law and the PDMThe body's AI checks the rule results; staff take the decisions that need judgement
6Something is missing, so the file goes back to you. RepeatThe file arrives complete, so there is far less back and forth

The loop between steps 5 and 6 is where the time goes today: a file can take months, even years. Acts that the law reserves to a notary still go to one.

Not everyone has, or wants, an AI. The same gates serve a clerk at a counter, who prepares the file for you, and a phone line. The AI is one way in, never the only one.

Example: a building licence

No planning software sits in between: the council publishes its PDM as rules through its read gate. Decree-Law 10/2024 wrote automatic checking of projects against the PDM into law; Decree-Law 108/2026 removed it in May 2026, so councils still do that check by hand.

  1. Ask: what can I build here? Your AI reads the PDM rules and the plot's zoning from the council's read gate, before any application exists.
  2. Prepare the file. Your AI, or your architect's, drafts the project and tests it against the published rules until every rule passes.
  3. Apply. Your AI files it in the council's intake, under the procedure the law already sets.
  4. Decide, faster. The council's AI checks the rule results. A technician decides anything that needs judgement, and any refusal.
  5. Write only the licence. The signed decision opens the write gate for the licence data. The drawings stay in the intake until they are deleted on schedule.
  6. Tell the others. The tax, land registry and statistics bodies get notices. Anyone can ask for anonymous figures, such as licences per parish or time to decide.

A working example of the council's read gate, built as an MCP server, is online: see the MCP demo.

Safeguards

The design has thirteen weak points we know of, and each has a safeguard. None breaks the idea; most make the design safer.

Known weak points of the design and their safeguards.

RiskSafeguard
A stolen or misused key writes anything that passes the quality rulesA signed decision opens the write gate, once, for exactly the approved fields. Keys are short-lived and can be revoked
The machine-readable rule differs from the official text, and a citizen files a wrong case in good faithRules are signed, versioned and linked to the Diário da República. Every decision cites the version it used, and nobody is penalised for the body's error
Some acts are reserved to lawyers, solicitors and notariesSelf-filing covers what you do for yourself; professionals can file with AI for their clients. Clear, documented rules are the case for reviewing a reservation
A plausible but false value passes every ruleEvery value records who wrote it and under which decision. Corrections are new entries, registers cross-check by asking, and unusual write patterns raise alerts
One universal number, the NIF, makes profiling easy if anything leaksEach sector gets its own identifier, derived from the citizen's, as Austria does. Only a service the person can audit translates between them
The intake holds drawings and documents far beyond what the register keepsFiles are deleted when the appeal period ends. No other body can query an intake
An automated refusal is hard to justify and to contestEach body publishes its decision policy. AI may approve clear cases but never refuses alone, and a person handles appeals
A file hides text telling the reviewing AI to approve it, or agents flood an intakeRules decide and AI only explains. Text in a file is data, never instructions. Limits apply per mandate, and address-book entries are signed
Anonymous statistics are combined to single people outGates give answers, not records. Statistics have minimum group sizes, added noise and a budget per user. Every read that identifies a person appears in that person's own log
A death or a sale reaches one register but not anotherEach register keeps a numbered, signed change log, and receivers read on from where they stopped
Gates are added on top and nothing is switched off, so IT spending risesEvery gate ships with a switch-off date for what it replaces, tracked in public contract data
A State built only for agents leaves people outThe same gates serve a counter clerk and a phone line
Replacing 594 systems at once is impossibleGo body by body, as set out under Getting there

What it saves

The savings come from the custom software between the public and the registers: forms, portals, workflow systems and point-to-point integrations. Software and IT services averaged about €890M a year of contracts in 2022–2025. The model leaves networks, devices and the running of databases alone.

Illustrative yearly savings.

If this share of software and IT services goesYearly saving
10%≈ €89M
25%≈ €222M
50%≈ €445M

These are illustrations, not estimates. Which share is software in between, and which is necessary running cost, is the next research step. Contract value is also not yearly spending: a three-year licence counts in full in the year it is signed.

Two more effects point the same way:

  • Small councils pay twice as much per resident. Over 2022–2025, councils under 5,000 residents signed €97 of IT contracts per resident, against €49 for councils of 20,000–50,000. The same core systems are spread over fewer people. Shared registers and gates spread that cost nationally.
  • Lock-in costs too. €1.35bn of IT contracts, 12.6% of all IT value, were direct awards on the ground that only one supplier can do the work. In 2022–2025 that ground covered 61.5% of IT direct-award value, against 39.2% outside IT. Citing it is legal and implies no irregularity; standard protocols and published rules make it harder to need.

Getting there

There is no big bang. Each body goes through four steps on its own timetable, and the savings arrive only when the old software is switched off.

Getting there: four steps per body. The savings arrive only at step 4.

We propose three first bodies: building licences in one council, property (land registry, tax register of properties and cadastre), and public contracts. Each redesign gets a map of today next to the model, and a cost line. A working example of step 1 for building licences, a council read gate built as an MCP server, is online as the MCP demo.

What a real building-licence service needs

The MCP demo runs the building licence on real Cascais rules and open data, with fictitious applicants and plots. Turning it into a service people can rely on is mostly a question of who answers for the rules, the data and the decisions. The work falls into three stages, by what the law allows today.

From the demonstration to a service, in three stages.

Usable under today’s law

  • The council adopts the rules. A planner and a lawyer review the 75 checks, the points marked unverified are settled, and the encoding is checked against the plan as published in the Diário da República. The council then publishes the rules as its own, with a version number, so that it answers for them.
  • The official layers. The plan and constraint maps in force. The demo uses DGT’s harmonised land-use map, which does not replace the plan, and constraint layers from 2022. Planning units (UOPG), urban regeneration areas (ARU), the REN’s types and other national constraints, such as Natura 2000 and the agricultural reserve (RAN), are not open data or not loaded yet.
  • Someone keeps the rules current. Every change to the RJUE, the plan or the fee table is a new version of the rules. The RJUE alone was amended by Decree-Laws 10/2024 and 108/2026.
  • The missing cases. Rural land, detail plans and allotments, which the demo sends to a person.

Needs agreements with other bodies

  • Identity and signature. The national form already asks for a signature with the Cartão de Cidadão or the Chave Móvel Digital, and, for professionals, the professional attributes system (SCAP). Someone filing for another person needs a mandate. MCP’s authorisation standard, OAuth, could carry a temporary key issued after signing in with Autenticação.gov; whether Autenticação.gov issues such keys to other servers today is still to check.
  • The real plot. The demo invents the plot. A real application needs the property’s land-registry description (IRN) and its tax-register article (AT), read through the public administration’s interoperability platform (iAP), not from open data.
  • The council’s case system. The filed form and its documents must arrive in the system the council already runs, often bought from municipal software suppliers such as AIRC and Medidata. Payment of fees and electronic notices need the same.
  • The drawings. The engine checks the values the form declares, not the drawings. The law already relies on the signed responsibility statements of the projects’ authors, and a service can keep that rule.

Needs a change in the law

The licence is an act of the council, which can delegate it only to people (RJUE art. 5). A decision with significant effects taken by an algorithm must be communicated to the people concerned, be open to appeal and be auditable (Lei 27/2021, art. 9; GDPR art. 22). By our analysis, three of the 75 checks need such a change, all about who issues the act. Until then the council’s AI prepares the decision and a person with delegated competence signs it, which still removes most of the checking. Whether the AI Act classes this use as high-risk is still to check.

Running it

  • Hosting under the council’s control, an impact assessment under the GDPR, and a log of every decision.
  • Evaluation of the AI models used, with models hosted in the EU for real data.
  • The accessibility rules for any page people use (Decree-Law 83/2018).

The smallest real pilot

One council, one procedure (a new house) and a few months running alongside the staff, without replacing them. Measure the share of incomplete applications and the time to a decision, then decide on the rest. The first stage is enough for this pilot.

Open questions

Five questions remain open before this becomes a costed plan.

  • The law. Which decisions AI may take alone under GDPR art. 22 and the AI Act; how self-filing fits with acts reserved to lawyers, solicitors and notaries; and how rules published as data can be made binding.
  • Identifiers. Which identifier each register uses today, and where they fail to line up, starting with property.
  • The savings method. Splitting each body's IT contracts into software in between and running costs, to turn the illustration into an estimate.
  • How long files take today. We say a file can take months, even years; that needs official processing-time data per procedure.
  • The pilots. Which council and which register go first, and who runs them.

References

Our own work, not yet published:

  1. surfingdog.pt, Portugal public IT map, October 2026: 594 systems and organisations and 1,080 links, compiled from public sources. Its public version, with 996 links, is the IT map.
  2. surfingdog.pt, Portugal public IT costs, 2012–2026: contract values by year, type, buyer and council size, and the single-supplier ground (CCP art. 24(1)(e)), from Portal BASE open data published by IMPIC on dados.gov.pt, exported in October 2026, with Census 2021 populations.
  3. surfingdog.pt, Portal BASE open data, as it really is: the data-quality and privacy counts.
  4. surfingdog.pt, Urbanismo: the national platform: what the building-licence reform says about checking projects against the PDM.

Laws and other sources:

  1. Decree-Law 10/2024 and Decree-Law 108/2026, Diário da República.
  2. European Interoperability Framework, COM(2017) 134, where "base registries" comes from.
  3. GDPR, Regulation (EU) 2016/679, art. 22, on automated individual decisions.
  4. Regime Jurídico da Urbanização e da Edificação (Decree-Law 555/99), art. 5, on who is competent for the licence.
  5. Lei 27/2021, Carta Portuguesa de Direitos Humanos na Era Digital, art. 9, on decisions taken with algorithms.
  6. Portaria 320/2026/1, the national application forms, read in the copy published by Câmara Municipal de Cascais; it names the Cartão de Cidadão, the Chave Móvel Digital and SCAP for signing.
  7. Decree-Law 83/2018, on the accessibility of public bodies’ websites and apps.
  8. AI Act, Regulation (EU) 2024/1689, Annex III, on high-risk uses, including access to essential public services. Which uses apply is still to check.
  9. European Digital Identity, Regulation (EU) 2024/1183, the wallet behind "prove".
  10. Single Digital Gateway, Regulation (EU) 2018/1724, the once-only principle.
  11. Interoperable Europe Act, Regulation (EU) 2024/903.
  12. Data Governance Act, Regulation (EU) 2022/868, on re-using protected public data.
  13. X-Road, the decentralised data exchange used by Estonia and Finland.

Still to verify: Lei 49/2004 on reserved acts; Estonia's data tracker; Austria's sector-specific identifiers under its E-Government Act.