AI laws in Mexico: Legislators who do not understand what an algorithm is

2026-05-14

Internal image: AI laws in Mexico: Legislators who do not understand what an algorithm is

There is a phrase that I repeat every time I am invited to a workshop on technological regulation in Mexico. I repeat it because every time I say it, the lawyers laugh nervously and the engineers nod with the lost look of someone who has seen too much.

The phrase is this: they regulate the 21st century with 19th century minds.

It's not an insult. It's a diagnosis. And like any diagnosis, what it seeks is not to offend the patient but to describe the disease with the precision necessary to treat it.

The disease is this: Mexico is trying to legislate on artificial intelligence, and the people who are writing, debating and voting on those bills do not understand the technology they seek to regulate. They don't understand it at a conceptual level. They don't understand it on a technical level. And the most worrying thing: they don't know that they don't understand it.

During my professional career in computer forensics. I have trained forensic experts in Latin America. I have read technology bills that have caused me everything from intellectual amazement to physical pain. And the bills on artificial intelligence that are being discussed in the Mexican Congress fall, with honorable exceptions, closer to physical pain than amazement.

This article is for the software entrepreneur who is worried that the upcoming law could affect their product and needs to understand how informed the legislators are who are writing it. For the lawyer who litigates cases where technology is relevant and needs to know if the legal framework that is being built is going to be useful or is going to be an obstacle. For the journalist who covers legislative issues and needs a technical lens to evaluate what legislators say on the platform. For the citizen who wants to understand why regulating AI should matter to them and why who regulates it should matter even more. And for the legislator who has the honesty to read this and ask himself: "Do I really understand what I am regulating?"

Let's anticipate: in most cases, the answer is no.

Mistake one: confusing artificial intelligence with automation

This is the most basic and most widespread error. And I have seen it in the literal text of legislative proposals that have been formally presented to Congress.

Automation and artificial intelligence are not the same. They are not synonyms. They are not variants. They are different concepts that operate at different technological levels.

Automation is programming a machine to do a repetitive task following explicit instructions. An ATM is automation. A spreadsheet that adds columns is automation. A traffic light that changes from red to green every 90 seconds is automation. None of these systems "think." No one "learns." None "decide" in the sense in which artificial intelligence decides. They execute instructions. Spot.

Artificial intelligence -- in its contemporary technical usage -- refers to systems that use statistical models trained with data to identify patterns, make predictions, or generate content. When a language model generates text, it is not following explicit instructions on what to write. It's calculating probabilities of which word comes after which, based on patterns learned from millions of texts. When a facial recognition system identifies a person, it is not comparing pixel by pixel against a database. It is using a mathematical representation of the face to look for statistical similarities.

The difference matters enormously for regulatory purposes. Because if the law defines "artificial intelligence" to include any form of automation, then it regulates everything. The corner store point of sale system. Inventory control of a pharmacy. The programmable alarm for your home. Everything is "artificial intelligence" under a definition that does not distinguish between automating and learning.

I have read proposals where the definition of AI is so broad that a spam filter would qualify as a regulated system. And I've read proposals where the definition is so narrow that it excludes automated decision systems that are making real decisions about real people.

Software entrepreneur developing systems with decision algorithms: Your system can be within or beyond the law's reach depending on whether the legislator understands the difference between "a program that follows rules" and "a model that learns data." If you don't understand her and proposals suggest that in many cases you don't understand her, get ready for an uncertain regulatory scenario where nobody knows whether or not your product's regulated.

Mistake Two: Regulating the Tool Instead of Using it

This is a misconception that reveals a fundamental misunderstanding of how technology works.

Several bills treat artificial intelligence as an entity that can be regulated by itself. Like an "A." That's something. An object. A device that you can put in a box, put a check seal and declare "as required."

But artificial intelligence is not a thing. It is a category of technologies with radically different applications. The same neural network technology used to diagnose cancer in medical images is used to generate pornographic deepfakes. The same natural language processing technology used to improve accessibility for people with disabilities is used to generate automated disinformation campaigns. The same pattern recognition technology used to detect bank fraud is used for mass surveillance without consent.

To regulate "artificial intelligence" is how to regulate "chemistry." Chemistry production medicines that save lives and produce poisons that remove them. To regulate chemistry as a whole doesn't make sense. What's regulated is the use: what medicines can be sold and under what conditions, what substances are prohibited, what safety protocols should be followed in a laboratory.

The same should apply to AI. The neural network is not regulated. The use of the neural network is regulated. The credit scoring system that discriminates by zip code is regulated. The facial recognition system that operates without consent is regulated. The generation of deepfakes with the intention of harm is regulated. The applications are regulated, not the base technology.

But this requires that the legislator understand that the base technology is neutral and that what changes is the application. And to understand that, you need to understand the technology. What is a model? What is training? What is a parameter? What is an algorithmic bias. What is inference.

I am not asking that the legislator know how to program. I am asking that you understand the basics of the technology you are regulating as deeply as you understand the basics of the law you apply every day. Because if a lawyer does not understand the difference between an intentional crime and a culpable crime, he cannot litigate. And if a legislator does not understand the difference between a generative model and a system of rules, he cannot legislate on artificial intelligence.

Lawyer who reads me and has clients in the technology sector: When the law's passed, you'll be the one to interpret what that means to your client. If the law regulates "IA" as a monolith, you will have to determine if your client's system falls into the scope of the regulation. And that determination will be a minefield of ambiguities because the law was not designed with the technical accuracy necessary to give clear responses.

Lawyer who reads me and who has clients in the technology sector, in "AI Laws in Mexico: Legislators who do not understand what an algorithm is"

Mistake three: confusing algorithm with artificial intelligence

This is where the title of this article comes to fruition.

An algorithm is a sequence of instructions to solve a problem. A kitchen recipe's an algorithm. The steps to solve a quadratic equation are an algorithm. The procedure followed by a public prosecutor's office to start an investigation folder is an algorithm. Not every algorithm's artificial intelligence.

What makes a system "intelligent" in the contemporary technical sense is not that it has an algorithm. All software has algorithms. What makes it "smart" is the ability to learn from data, to adjust its behavior based on what it learns, to generalize from examples. That's machine learning. That's what distinguishes an AI system from a conventional program.

I have heard legislators use the word "algorithm" as a synonym for "artificial intelligence." I have read proposals where they talk about "regulating algorithms" when what they want to regulate are machine learning models. The confusion is not semantics. It's conceptual. And it has concrete regulatory consequences.

If the law says "the algorithms used to make decisions about people have to be audible," that sounds reasonable. But technically, an "algorithm" can be a function of three code lines or a model of 175 billion parameters. The audibility of both are radically different exercises. Audit a 3-line feature takes minutes. Audit of a big language model requires months, specialized equipment and access to training data that companies consider commercial secrecy.

The law must be precise in its terminology. You have to distinguish between a deterministic algorithm -- which always produces the same result for the same input -- and a probabilistic model -- which produces variable results based on learned statistical distributions of data. Because the regulation of one and the other are fundamentally different.

Journalist covering these proposals: The next time a legislator says "we'll regulate the algorithms," ask him what kind of algorithm you mean. If she looks at you with a face of confusion, there's your note. Because someone who can't figure out how to regulate them.

Mistake four: phantom regulation

I call "ghost regulation" proposals that create obligations that cannot be met because the technology does not work the way the legislator thinks it works.

I will give concrete examples because this mistake is particularly bad.

"AI systems must explain their decisions." This phrase appears, with variations, in multiple law proposals in Mexico and around the world. And it sounds perfectly reasonable. If an algorithm denies you credit, you have the right to have them explain why. Nobody disputes the principle.

The problem is technical: deep learning models -- neural networks with millions or billions of parameters -- are not inherently explainable. They don't work with rules like "if you earn less than 20,000 pesos, deny credit." They work with numerical weights distributed in layers of artificial neurons that interact in ways that not even the model creators themselves can articulate in human language.

There are "explainability" techniques -- SHAP, LIME, attention maps -- that can give approximations of why a model made a decision. But they are approximations. They are not causal explanations. They are statistical interpretations of the variables that most influenced the result. And those interpretations can be misleading if not understood correctly.

So, when the law says "must explain," the technical question is: what level of explanation is sufficient? A statistical approach? A list of the five most influential variables? A natural language narrative generated by another AI model that interprets the first? None of those are an "explanation" in the traditional legal sense. They are the best that technology can offer today. And the law needs to recognize that instead of creating an obligation that sounds good but cannot be met with the current state of technology.

"AI systems should not discriminate." Another phrase that appears constantly. And again, the principle is unobjectionable. The problem is that machine learning models learn from historical data, and historical data contains the biases of the society that generated it. If you train a model with hiring data from the last 20 years, and in those 20 years there was gender discrimination in hiring, the model will learn that discrimination and reproduce it.

Telling the model "don't discriminate" doesn't work because the model doesn't consciously discriminate. He has no conscience. He has no intention. It has statistical patterns. And those patterns reflect the data it was trained on. Correcting bias requires specific debiasing techniques, it requires constant audits, it requires equity metrics that are the subject of active debate in the academic community. It is not a switch that turns off.

The law that says "AI systems must not discriminate" without defining what constitutes algorithmic discrimination, how it is measured, who audits it and how often, is a law that sounds good on the platform but is inapplicable in practice.

"All AI-generated content must be tagged." It seems simple. In practice, it requires that each piece of content generated by a model -- text, image, audio, video -- carry a visible or invisible label that identifies its synthetic origin. The problem: open source models can be modified to not label. Invisible labels (watermarks) can be removed. Visible labels can be cropped. And there is no technological mechanism to force a model running on a person's computer to label its output.

Each of these legislative mandates sounds reasonable in the document. Each is technically problematic in implementation. And the gap between mandate and implementation is exactly the space where the law becomes phantom regulation: it exists on paper, it does not exist in reality.

Mistake five: legislating without consulting

This is the mistake that frustrates me the most, because it is the easiest to fix.

Mexico has data scientists. It has machine learning engineers. It has research laboratories in artificial intelligence. It has universities with departments dedicated to the subject. You have companies that develop and deploy AI systems. You have forensic experts forensics working with the consequences of AI every day.

And however, bills are drafted in legislative office without formal technical consultation. Or with consultations that are simulations -- they are invited to an expert panel, they are heard for 45 minutes, they are grateful and the proposal is submitted without including a single comment.

I have participated in working groups where I presented specific technical observations on regulatory proposals. Documented, substantiated observations with concrete examples of why a wording was technically incorrect. And I saw them ignored in the final version of the document. Not because they were incorrect. But because incorporating them required rewriting entire sections, and no one wanted to delay the legislative calendar.

That dynamic -- prioritizing legislative speed over technical precision -- is exactly how laws are produced that regulate technologies they don't understand. It is legislated first, it is understood later. And "afterwards" generally means "when the courts have to interpret what we wanted to say but didn't know how to express."

Legislator who reads me: I'm not asking him to become an engineer. I'm asking her not to legislate about what she doesn't understand without the advice of whoever does. I'm asking that the team that drafted a bill about artificial intelligence include at least a data scientist, an autolearning engineer, a forensic expert digital forensic and a law and technology specialist. Not as an outside consultant. as part of the drafting team.

Because legislating on artificial intelligence without an AI expert is like legislating on medicine without a doctor. It can be done. But the result is going to be a law that, when applied, will produce effects that no one anticipated because no one who understood the issue was at the table when it was written.

Legislator who reads me, in “AI Laws in Mexico: Legislators who do not understand what an algorithm is”

Legislating without understanding is worse than not legislating

And here I come to the core of this article. The thesis I need you to understand with all the clarity I can give you.

Bad legislation on artificial intelligence is worse than no legislation at all.

I'm not saying that legislation shouldn't be done. I already made it clear in the previous article that regulation is necessary. What I am saying is that a poorly made law produces concrete damage that the absence of law does not produce.

Damage one: false protection. A law of IA creates a public expectation that their digital rights are protected. If the law was inapplicable for technical deficiencies, protection did not exist but expectations did. The citizen thinks she's protected. He's not. And when she needs that protection -- when an algorithm denies her a service, when a pepfake destroys her reputation, and an automated system misclassifies her -- she finds that the law she thought she was protecting her was a paper without teeth.

Damage two: legal uncertainty. A law with vague definitions, with technically impossible mandates with incorrect terminology, creates legal uncertainty for all actors. Technology developers don't know if they're complying or not. Lawyers don't know how to interpret mandates. The judges don't know how to apply them. Citizens do not know what rights they have. Legal uncertainty was not neutral. It benefits whoever can pay lawyers who find and exploit ambiguities. He's a bad man.

Damage three: the cooling effect. Excessive and poorly calibrated regulation can inhibit legitimate innovation. If a software developer doesn't know if his client care chatbot will put him into a regulatory mess, choose to avoid developing him. If a company doesn't know whether its demand prediction model qualifies as "high-risk IA system," it chose to avoid using them. Regulation that doesn't distinguish between high-risk and harmless applications freezes the whole ecosystem alike.

Damage four: the gap with reality. A law that doesn't understand technology creates a continuous divide between what law says and what technology does. And that divide widens with time, as technologies are evolving at a speed that legislative reforms cannot match. In three years, IA's capabilities will be radically different from today's. If the law was written without understanding today's capabilities, it will be completely obsolete from tomorrow's capabilities.

What should be happened (and what's likely to be wrong)

What should happen is this:

Proposed laws on artificial intelligence should go through an independent technical review process. A panel of experts -- data scientists, AI engineers, forensic experts forensics, technology lawyers -- should review each proposal, identify conceptual errors, terminological inaccuracies, technically impossible mandates, and issue a binding technical opinion. Not consultative. Binding. That the legislator cannot approve a law that a panel of experts has ruled as technically deficient.

Legislative committees that handle technological issues should have permanent technical teams. Not advisors who come and go. Permanent teams with high-level technical capacity that can evaluate proposals, write technically precise texts and monitor implementation.

Regulation should be iterative. Instead of attempting an all-encompassing law that regulates all AI at once, start with specific sectoral regulations: AI in the financial sector, AI in the health sector, AI in public administration, AI in media and communication. Each sector has different risks, different actors, different regulatory needs. A single law for everything is a law that does not serve anything well.

The regulation should include mandatory review clauses. Every two or three years, the law should undergo a technical review to determine whether the definitions remain relevant, whether the mandates remain technically feasible, whether new technologies or applications have emerged that the original law did not contemplate. Technology does not wait for the law to catch up. The law has to incorporate mechanisms to catch up with technology.

What's likely to happen: a law with conceptual mistakes that nobody's going to fix because redressing them will require admitting that they have been committed. The courts will have to interpret vague terms on a case-by-case basis, generating contradictory jurisprudence. The law will be partially inapplicable by technically impossible mandates. And in five years, someone's going to propose a reform because the original law "was already exceeded by technology," when the reality was that the technology had been exceeded by its adoption.

The forensic perspective: what I see from the laboratory

I'm gonna close with what I see every day from Doriva. Because the perspective of a forensic expert forensic about IA regulation isn't theoretical. That's practice. That's what I have to face with every case, every report and every hearing.

I see judges who don't know how to evaluate evidence with artificial intelligence. I see lawyers that don't know how to challenge or uphold multimedia evidence in a world of deeply fakes. I see public ministries that don't know what to ask when IA's relevant to an investigation. I see citizens whose rights have been violated by an automated system and who have no clear legal remedy to defend themselves.

That was all a result of a divide: the divide between the speed at which technologies advanced and the speed at which the legal framework was updated. The law of IA should close that divide. If with technical knowledge, close it. If it's done without him, I'll get her ready.

During my professional career at the intersection between technology and law. I have seen that gap grow with each new technology that arrives and with each law that is passed without understanding it. And what I have learned is that legislative speed does not close the gap. The legislative quality closes it.

The forensic perspective: what I see from the laboratory, in "AI Laws in Mexico: Legislators who do not understand what an algorithm is"

An invitation, not an insult

They regulate the 21st century with 19th century minds. Not because they're incapable. That's because they haven't taken the time to understand the century they're regulating.

I have trained forensic experts in Latin America. I have written six books. I have analyzed evidence in trials where technology was the centerpiece. And throughout that time, the constant has been the same: the legal system runs behind technology, never alongside it.

The AI law in Mexico has the opportunity to break that pattern. To legislate with knowledge, with precision, with the humility of consulting those who understand what is being regulated. But to break the pattern, you must first recognize that it exists.

The phrase I repeat at every work table is not an insult. It's an invitation. The invitation is this: stop regulating what you do not understand on your own. Invite someone who understands it to the table. Not for me to explain to them after the law is written. So that I can explain to you before.

Because legislating without understanding is not bravery. It's recklessness. And recklessness, in a laboratory, breaks equipment. In a Congress, it breaks rights.

Contact
Let's talk about your case
Open contact form