Apple helped the US government build a "top secret" iPod with hidden sensors inside, a former employee has revealed.
Only four people at the company knew about the project, according to former Apple software engineer David Shayer.
Two men from a defence contractor had arrived at Apple in 2005, on behalf of the US Department of Energy, he said.
They had wanted help to build an iPod that looked and worked just like a normal one but secretly recorded data using hidden extra hardware inside.
Apple had helped the engineers build a custom version of the iPod software to accommodate the secret device, Mr Shayer said.
"They were careful to make sure I never saw the hardware," he wrote in a lengthy post for Apple newsletter Tidbits.
"And I never did."
He said the two engineers, from defence contractor Bechtel, had worked out of an office at Apple's buildings for months.
"They wanted to add some custom hardware to an iPod and record data from this custom hardware to the iPod's disk in a way that couldn't be easily detected," he wrote.
"But it still had to look and work like a normal iPod."
The pair had been given a copy of the iPod system's source code on DVD and bought their own devices at shops to experiment on, Mr Shayer said.
"This wasn't a collaboration with Bechtel with a contract and payment," he wrote.
"It was Apple doing a favour under the table for the Department of Energy."
Mr Shayer never found out exactly what the two engineers were building but suspected "something like a stealth Geiger counter" to measure radiation without being noticed.
The Department of Energy is, among other functions, responsible for nuclear power.
The story has been backed by other Apple employees of the time.
Tony Fadell, the former vice-president of the iPod division, tweeted the story was "absolutely spot on" and "real without a doubt".
You should have seen the guys behind those 2 engineers… What a trip! I’m still friends with one of them today. Crazy super cool technology the government was working on then… I can only imagine what is cooking these days. https://t.co/ysZgmq1ldm— Tony Fadell (@tfadell) August 18, 2020
"Crazy super cool technology the government was working on then… I can only imagine what is cooking these days," he added.
Apple has yet to respond to a request for confirmation of the story.
The company has made privacy a key marketing point of its iPhones, leading to disagreements with the US Department of Justice.
But the high level of secrecy - and the fact the four people who had known about it had all since left Apple - meant, Mr Shayer said: "The PR people would tell you honestly that Apple has no record of any such project."